- Descriptions
- Prerequisites
- Installation
- Features
- Use and examples of results
- Deploying the application on Streamlit Cloud
- Contribution
- Author
This application predicts Iris flower species using a machine learning model trained on the Iris dataset. It classifies a flower into one of three species: Setosa, Versicolor, or Virginica, based on its physical characteristics, such as the length and width of the sepals and petals.
The project uses FastAPI to expose an API capable of handling prediction requests via HTTP requests. An interactive user interface has been developed with Streamlit, enabling users to enter the characteristics of a flower and obtain an immediate prediction. To simplify deployment and improve scalability, the entire project is orchestrated in a Dockerized environment.
On the backend, the application integrates with MongoDB to manage data storage, offering functionalities such as adding and listing fruits, illustrating basic interactions with a database.
The machine learning model used is the KNeighborsClassifier, a supervised algorithm based on the k-nearest neighbors (k-NN) method. This model was trained on the Iris dataset, a well-known dataset containing information on 150 flower samples, with four features per sample (length/width of sepals and petals).
The application allows the user to :
- Enter the characteristics of an Iris flower.
- Get an instant prediction of the flower species.
- View results in text and image format for different species (Setosa, Versicolor, Virginica).
- View model metrics.
- Docker, Docker Compose and Docker Desktop installed on your machine.
- Python 3.8 or higher
- pip (to install dependencies)
- A virtual environment (optional but recommended)
To run this project, follow the steps below:
- Clone the repository
- Run the following command in your terminal to clone the GitHub repository:
git clone https://github.com/karamoko17/Projet_MlOps.git- Access the project directory
- Navigate to the cloned directory:
cd Projet_MlOps- Build and start Docker containers
- Run the following command to create the Docker images and start the containers:
docker-compose up --build - Accessing the application
- To access the application, open your browser and enter the following URL:
http://localhost:8501/You're ready to use the project! 🚀
- Interactive interface via Streamlit
- Prediction of Iris flower species (Setosa, Versicolor, Virginica)
- Display of model metrics
- Visualization of ROC and Precision-Recall curves
The application offers two main interfaces: a Prediction Page, dedicated to the classification of Iris flowers, and a Metrics Page, which visualizes the model's performance.
- Prediction Page: This page allows the user to enter the characteristics of a flower, such as the length and width of its sepals and petals. Once the data has been entered, simply click on the Predict button to obtain the result. For example, for specific characteristics, the model can predict that the flower's species is Setosa. In addition, an image illustrating the predicted species is displayed, providing a clear and intuitive visualization of the result.
- Metrics page: This page presents model performance via indicators such as accuracy, classification ratio, as well as ROC and Precision-Recall curves. These visualizations make it easy to assess the quality of the model's predictions.
The application has been deployed on Streamlit Cloud, offering an interactive interface accessible via the following link: Access the application or https://irispredictionappawakaramoko.streamlit.app/.
With this deployment, users can easily interact with the application to make predictions on Iris flowers, view results as images and consult model metrics. Streamlit Cloud makes the application available online, without the need for complex infrastructure, offering a fluid user experience accessible from any browser.
Contributions are welcome! Feel free to open a ticket or submit a pull request to suggest improvements. Here's how you can get involved:
- Clone the project.
- Create a branch for your feature.
- Make your changes and validate them with a clear message.
- Push your changes to your branch on the remote repository.
- Submit a pull request to have your contribution reviewed.




