{"id":24530678,"url":"https://github.com/adiseshu-sdet/ai-model-testing","last_synced_at":"2026-05-16T18:09:24.573Z","repository":{"id":272644954,"uuid":"917295555","full_name":"Adiseshu-SDET/ai-model-testing","owner":"Adiseshu-SDET","description":"This project demonstrates a complete workflow for developing, testing, and deploying an AI model. The primary objective is to build and test a machine learning model, expose it via a REST API, and automate the entire process using CI/CD pipelines. Below is a detailed summary of the work done.","archived":false,"fork":false,"pushed_at":"2025-01-18T01:31:43.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T17:55:11.428Z","etag":null,"topics":["dockerization","flask-rest-api","logistic-regression","machine-learning","python3","scikit-learn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adiseshu-SDET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-15T18:07:41.000Z","updated_at":"2025-01-18T01:31:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"c503069f-b895-441d-ae3b-7242f734a482","html_url":"https://github.com/Adiseshu-SDET/ai-model-testing","commit_stats":null,"previous_names":["adiseshu-sdet/ai-model-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Adiseshu-SDET/ai-model-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiseshu-SDET%2Fai-model-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiseshu-SDET%2Fai-model-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiseshu-SDET%2Fai-model-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiseshu-SDET%2Fai-model-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adiseshu-SDET","download_url":"https://codeload.github.com/Adiseshu-SDET/ai-model-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiseshu-SDET%2Fai-model-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33113510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerization","flask-rest-api","logistic-regression","machine-learning","python3","scikit-learn"],"created_at":"2025-01-22T08:17:13.441Z","updated_at":"2026-05-16T18:09:24.535Z","avatar_url":"https://github.com/Adiseshu-SDET.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Model Testing Project\n\nThis project demonstrates a complete workflow for developing, testing, and deploying an AI model. The primary objective is to build and test a machine learning model, expose it via a REST API, and automate the entire process using CI/CD pipelines. Below is a detailed summary of the work done.\n\n---\n\n## **Table of Contents**\n1. [Project Description](#project-description)\n2. [Setup Instructions](#setup-instructions)\n3. [Key Features](#key-features)\n4. [Step-by-Step Workflow](#step-by-step-workflow)\n5. [CI/CD Pipeline](#cicd-pipeline)\n6. [API Usage](#api-usage)\n7. [Technologies Used](#technologies-used)\n8. [License](#license)\n\n---\n\n## **Project Description**\nThis project involves:\n1. Building a machine learning model to predict survival on the Titanic dataset.\n2. Automating testing for the model’s functionality and accuracy using PyTest.\n3. Exposing the trained model as a REST API using Flask.\n4. Containerizing the application using Docker.\n5. Automating CI/CD workflows using GitHub Actions.\n\n---\n\n## **Setup Instructions**\n\n### **Pre-requisites**\n- Python 3.9 or above\n- Docker installed on your machine\n- A GitHub account\n- Optional: Docker Hub account\n\n### **Setup the Project**\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd ai-model-testing\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Run the Flask application locally:\n   ```bash\n   python app.py\n   ```\n\n4. Test the application locally:\n   ```bash\n   pytest\n   ```\n\n5. Build and run the Docker container:\n   ```bash\n   docker build -t ai-model-api .\n   docker run -p 5000:5000 ai-model-api\n   ```\n\n---\n\n## **Key Features**\n- **Machine Learning Model**: Logistic regression on Titanic dataset.\n- **Testing**: Automated testing with PyTest.\n- **API**: Flask-based REST API for model predictions.\n- **Containerization**: Dockerized application.\n- **CI/CD**: GitHub Actions for automation.\n\n---\n\n## **Step-by-Step Workflow**\n\n### **1. Data Loading and Preprocessing**\n- Loaded the Titanic dataset.\n- Cleaned data by handling missing values and encoding categorical variables.\n- Prepared the data for training.\n\n### **2. Model Training and Evaluation**\n- Trained a logistic regression model.\n- Evaluated accuracy to ensure the model meets performance criteria.\n\n### **3. Automated Testing**\n- Wrote PyTest scripts to:\n  - Validate data preprocessing.\n  - Ensure model accuracy meets thresholds.\n- Integrated tests into the CI/CD pipeline.\n\n### **4. Exposing the Model as an API**\n- Created a Flask REST API with an endpoint to make predictions.\n- Tested the API locally with tools like Postman and cURL.\n\n### **5. Dockerization**\n- Wrote a Dockerfile to containerize the application.\n- Built and ran the Docker container locally.\n- Pushed the container image to Docker Hub.\n\n### **6. CI/CD Pipeline**\n- Configured GitHub Actions to:\n  - Run automated tests.\n  - Generate and upload test/coverage reports.\n  - Build and push the Docker image to Docker Hub.\n- Verified the pipeline’s success on every commit.\n\n---\n\n## **CI/CD Pipeline**\n\nThe GitHub Actions pipeline automates the following steps:\n\n1. **Checkout Code**:\n   - Clones the repository.\n2. **Set Up Python**:\n   - Installs dependencies from `requirements.txt`.\n3. **Run Tests**:\n   - Executes PyTest scripts.\n   - Generates test and coverage reports.\n4. **Build and Push Docker Image**:\n   - Logs into Docker Hub using GitHub secrets.\n   - Builds and pushes the Docker image.\n\n---\n\n## **API Usage**\n\n### **Endpoint**\n- **URL**: `http://\u003chost\u003e:5000/predict`\n- **Method**: POST\n\n### **Input Example**\n```json\n{\n  \"Pclass\": 3,\n  \"Sex\": 1,\n  \"Age\": 25,\n  \"SibSp\": 0,\n  \"Parch\": 0,\n  \"Fare\": 7.25,\n  \"Embarked\": 2\n}\n```\n\n### **Response Example**\n```json\n{\n  \"prediction\": 0\n}\n```\n\n---\n\n## **Technologies Used**\n- **Programming Language**: Python 3.9\n- **Libraries**: Flask, Scikit-learn, PyTest\n- **Containerization**: Docker\n- **CI/CD**: GitHub Actions\n\n---\n\n## **License**\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n### **Next Steps**\n1. Explore AI model testing techniques:\n   - Functional testing.\n   - Performance testing.\n   - Bias and fairness testing.\n2. Deploy the container on a cloud platform.\n3. Integrate notifications into the CI/CD pipeline.\n\n---\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadiseshu-sdet%2Fai-model-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadiseshu-sdet%2Fai-model-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadiseshu-sdet%2Fai-model-testing/lists"}