A web app that predicts the species of a Palmer penguin based on its features using Machine Learning (Random Forest Classifier)
The purpose of this ML Web App is to make a dynamic prediction of the species of a penguin based on its characteristics:
- Island
- Bill length
- Bill depth
- Flipper length
- Body mass
- Sex
In order to improve its performance, this project has two python files: one to create the model that will make the prediction of the species and another to execute the web app and get the user’s input to make the prediction with a call to the model.
The model can be updated to predict the species, sex or island of the penguin, just requiring to change the values of the corresponding column in the dataset that has the info to be predicted and its target information within the code.
In order to execute this project, it is necessary to have pandas
, sklearn
, streamlit
, pickle
and numpy
installed with python, all of these to be run into an Anaconda environment.
Procedure:
- Write the code for the classification model in Atom and save it as a .py file (
model_building_penguins.py
) - Launch Anaconda prompt to have python execute the .py file and return a pickle file with the ready-to-use model in the same folder (
penguins_clf.pkl
) - Write the code for the web app in Atom and save it as a .py file (
model_building_penguins.py
) - Execute the web app with Streamlit using Anaconda
- Upload a .csv file with the the characteristics of a penguin, or change the values of its characteristics in the left panel to predict in real time its species