{"id":15142596,"url":"https://github.com/presizhai/iris-predictor-fastapi","last_synced_at":"2025-12-25T10:49:37.102Z","repository":{"id":256906813,"uuid":"856780895","full_name":"presiZHai/iris-predictor-fastapi","owner":"presiZHai","description":"A web application for predicting the species of Iris flowers using a machine learning model trained with the Iris dataset, with FastAPI, a modern web framework for building APIs.","archived":false,"fork":false,"pushed_at":"2024-09-13T08:29:47.000Z","size":621,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T14:48:06.490Z","etag":null,"topics":["essemblelearning","fastapi","python","random-forest-classifier","scikit-learn","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/presiZHai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-13T07:35:17.000Z","updated_at":"2024-09-13T08:29:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"8171e873-69c3-4c76-8a02-f82ad8fce675","html_url":"https://github.com/presiZHai/iris-predictor-fastapi","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"4f312c0200ca7fe65ac80a899970862572bbe1ec"},"previous_names":["presizhai/iris-predictor-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presiZHai%2Firis-predictor-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presiZHai%2Firis-predictor-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presiZHai%2Firis-predictor-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presiZHai%2Firis-predictor-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/presiZHai","download_url":"https://codeload.github.com/presiZHai/iris-predictor-fastapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246368648,"owners_count":20766058,"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":["essemblelearning","fastapi","python","random-forest-classifier","scikit-learn","uvicorn"],"created_at":"2024-09-26T09:43:01.057Z","updated_at":"2025-12-25T10:49:37.056Z","avatar_url":"https://github.com/presiZHai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iris Flower Prediction App with FastAPI\n\nThis project is a web application for predicting the species of Iris flowers using a machine learning model trained with the Iris dataset. The app is built using FastAPI, a modern web framework for building APIs with Python 3.7+.\n\n![Iris Flower Prediction](templates/iris.webp)\n\n## Features\n\n- **Iris Flower Species Prediction**: The app predicts the species of an Iris flower based on its sepal and petal dimensions.\n- **Interactive Web Interface**: Users can input flower dimensions via a web form.\n- **REST API Endpoint**: The application also provides an API endpoint for programmatic predictions.\n\n## Technology Stack\n\n- **Python**: The programming language used for building the application.\n- **FastAPI**: A modern, fast (high-performance), web framework for building APIs with Python.\n- **Scikit-Learn**: A popular machine learning library in Python used for training the classification model.\n- **Jinja2**: A templating engine for Python, used for rendering HTML templates.\n\n## How to Run the Application\n\n### Prerequisites\n\n- Python 3.7 or higher\n- `pip` (Python package installer)\n- Virtual environment (recommended)\n\n### Setup Instructions\n\n1. **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/presiZHai/iris-predictor-fastapi.git\n    cd iris-predictor-fastapi\n\n2. **Create and activate a virtual environment**\n\n    ```bash\n    conda create --name iris-predictor pythn=3.10 -y\n    conda activate iris-predictor\n    ```\n\n3. **Install the required dependencies**\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. **Train the model**\n\nRun the following command to train the model: ```python train_model.py```\nThis will create a file named iris_model.pkl containing the trained model.\n\n5. **Run the application**\n\nYou can start the FastAPI application by running: ```python app.py```\nThe application will be available at http://127.0.0.1:8000.\n\n![Prediction](templates/iris-app.png)\n\n## API Usage\n\nEndpoint\n* POST /predict: Predicts the species of an Iris flower.\n\nRequest Body\n    {\n    \"sepal_length\": 5.1,\n    \"sepal_width\": 3.5,\n    \"petal_length\": 1.4,\n    \"petal_width\": 0.2\n    }\n\nResponse\n    {\n    \"predicted_class\": 0,\n    \"predicted_class_name\": \"setosa\"\n    }\n\n![API Endpoint](templates/iris.png)\n\n## HTML Templates\n* index.html: The main page where users can input flower dimensions for prediction.\n* result.html: Displays the prediction result after submitting the form.\n\n## Contributing\n* Contributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n* This project is licensed under the MIT License. See the LICENSE file for details.\n\n## Acknowledgments\n* The Iris dataset is used in this project, which is a popular dataset for classification and machine learning tasks.\n* Thanks to the creators of FastAPI and Scikit-Learn for their excellent tools.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresizhai%2Firis-predictor-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpresizhai%2Firis-predictor-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresizhai%2Firis-predictor-fastapi/lists"}