{"id":26090514,"url":"https://github.com/mohiteamit/simple_pipeline_using_iris","last_synced_at":"2026-04-16T20:45:52.074Z","repository":{"id":281315260,"uuid":"944904042","full_name":"mohiteamit/simple_pipeline_using_iris","owner":"mohiteamit","description":"Iris Classification Pipeline, Streamlit App \u0026 FastAPI","archived":false,"fork":false,"pushed_at":"2025-03-08T09:04:30.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T09:18:18.719Z","etag":null,"topics":["fastapi","iris-classification","iris-dataset","pipeline","python","sklean-classifier","stremalit"],"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/mohiteamit.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}},"created_at":"2025-03-08T07:43:20.000Z","updated_at":"2025-03-08T09:04:34.000Z","dependencies_parsed_at":"2025-03-08T09:18:26.277Z","dependency_job_id":"cec8325c-6a5a-4632-bd8e-2c330912d48a","html_url":"https://github.com/mohiteamit/simple_pipeline_using_iris","commit_stats":null,"previous_names":["mohiteamit/simple_pipeline_using_iris"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohiteamit%2Fsimple_pipeline_using_iris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohiteamit%2Fsimple_pipeline_using_iris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohiteamit%2Fsimple_pipeline_using_iris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohiteamit%2Fsimple_pipeline_using_iris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohiteamit","download_url":"https://codeload.github.com/mohiteamit/simple_pipeline_using_iris/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242673793,"owners_count":20167294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fastapi","iris-classification","iris-dataset","pipeline","python","sklean-classifier","stremalit"],"created_at":"2025-03-09T09:34:25.079Z","updated_at":"2026-04-16T20:45:47.033Z","avatar_url":"https://github.com/mohiteamit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iris Classification Pipeline, Streamlit App \u0026 FastAPI\n\nThis project demonstrates an end-to-end machine learning pipeline using the Iris dataset. It includes:\n- A training script that builds an automated ML pipeline (with preprocessing, model training, evaluation, and saving).\n- A Streamlit web application for model inference via a graphical interface.\n- A FastAPI application to serve model predictions via REST API endpoints.\n- A batch file that reads a `.env` file to initialize your virtual environment.\n\n## Project Structure\n\n```\n├── app.py             # Streamlit app for model inference\n├── api.py             # FastAPI app for serving predictions via REST API\n├── train_model.py     # Script to build, train, and save the ML pipeline\n├── iris_pipeline.pkl  # Saved model pipeline (generated by train_model.py)\n├── .env               # Environment variable file containing VENV path (to be created)\n├── init_venv.bat      # Batch file to initialize the virtual environment\n├── requirements.txt   # Python dependencies\n└── README.md          # This file\n```\n\n## Prerequisites\n\n- **Python 3.6+**\n- **pip** (Python package installer)\n- **Windows OS** (for the provided batch file)\n\n## Setup \u0026 Operation Order\n\n### 1. Clone the Repository\n\nClone this repository and navigate into its directory:\n\n```bash\ngit clone https://github.com/mohiteamit/simple_pipeline_using_iris.git\ncd simple_pipeline_using_iris\n```\n\n### 2. Create the `.env` File\n\nCreate a file named `.env` in the project root with the following content.  \nMake sure to replace `\u003cpath-to-your-virtual-environment\u003e` with the actual path to your virtual environment's activation script:\n\n```dotenv\nVENV=\u003cpath-to-your-virtual-environment\u003e\\Scripts\\Activate\n```\n\n### 3. Create/Activate the Virtual Environment\n\nYou have two options:\n\n#### Option A: Using the Provided Batch File\n\n1. With the `.env` file in place, run the batch file to initialize your virtual environment:\n\n   ```batch\n   init_venv.bat\n   ```\n\n#### Option B: Manually Activating Your Virtual Environment\n\nIf you prefer manual activation, run:\n\n```batch\n\u003cpath-to-your-virtual-environment\u003e\\Scripts\\Activate\n```\n\n### 4. Install Dependencies\n\nOnce your virtual environment is active, install the required packages using `requirements.txt`:\n\n```bash\npip install -r requirements.txt\n```\n\n### 5. Train the Model\n\nRun the training script to load the Iris dataset, preprocess the data, train a RandomForest classifier (within a pipeline), evaluate its performance, and save the pipeline to disk:\n\n```bash\npython train_model.py\n```\n\nAfter running the script, a file named `iris_pipeline.pkl` will be generated.\n\n### 6. Run the Streamlit App\n\nLaunch the Streamlit app to interact with the model via a graphical web interface:\n\n```bash\nstreamlit run app.py\n```\n\nIn your web browser, you can:\n- Input iris feature values (sepal length, sepal width, petal length, petal width)\n- Click the **Predict** button to view the predicted iris species\n\n### 7. Run the FastAPI App\n\nTo serve predictions via a REST API, launch the FastAPI server with:\n\n```bash\nuvicorn api:app --reload\n```\n\nBy default, the server will start at `http://127.0.0.1:8000`. You can access the interactive API documentation at `http://127.0.0.1:8000/docs` to test the `/predict` endpoint.\n\n## Additional Notes\n\n- **Automated Retraining:**  \n  You may schedule the training script using tools like cron jobs, Windows Task Scheduler, or advanced scheduling tools such as Airflow if needed.\n\n- **Modularity:**  \n  The training and inference stages are separated. You can update the model by re-running `train_model.py` without affecting the Streamlit or FastAPI interfaces.\n\n- **Customization:**  \n  Feel free to extend the pipeline (e.g., add more preprocessing steps) or enhance the Streamlit app and FastAPI endpoints (e.g., add logging, error handling, or additional visualizations).\n\n## App screenshot\n![alt text](image.png)\n\n## Contributing\n\nContributions and improvements are welcome. Please open an issue or submit a pull request for any suggestions or enhancements.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Contact\n\nFor questions or further information, please reach out to [mohite.amit@gmail.com].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohiteamit%2Fsimple_pipeline_using_iris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohiteamit%2Fsimple_pipeline_using_iris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohiteamit%2Fsimple_pipeline_using_iris/lists"}