A machine learning web app built with Streamlit that predicts the species of a penguin based on physical measurements. Choose from three classifiers and get instant predictions with accuracy scores.
π Live Demo: https://penguin-gp.streamlit.app/
This app uses the Palmer Penguins dataset to train three ML models and allows users to interactively input penguin measurements to predict whether a penguin is:
- π Adelie
- π΅ Chinstrap
- π’ Gentoo
- Interactive sidebar with sliders and radio buttons for input
- Three classifier options: SVM, Logistic Regression, and Random Forest
- Displays the predicted species with an image
- Shows the training accuracy score of the selected model
| Tool | Purpose |
|---|---|
| Python | Core language |
| Streamlit | Web UI framework |
| Scikit-learn | ML models |
| Pandas / NumPy | Data processing |
| Matplotlib / Seaborn | Visualization support |
βββ penguin_app.py # Main Streamlit app
βββ penguins.csv # Dataset (Palmer Penguins)
βββ README.md # Project documentation
git clone https://github.com/your-username/penguin-predictor.git
cd penguin-predictorpip install numpy pandas matplotlib seaborn streamlit scikit-learnPlace the penguins.csv file in the same directory as penguin_app.py.
You can download it from palmerpenguins or use the CSV from the seaborn datasets.
streamlit run penguin_app.pyThe app will open automatically in your browser at http://localhost:8501.
| Model | Description |
|---|---|
| Support Vector Machine (SVC) | Linear kernel SVM |
| Logistic Regression | Multinomial logistic regression |
| Random Forest Classifier | Ensemble of decision trees (n_jobs=-1) |
All models are trained on a 67/33 train-test split with random_state=42.
| Feature | Type | Description |
|---|---|---|
island |
Categorical | Biscoe, Dream, or Torgersen |
bill_length_mm |
Numeric | Length of the bill in mm |
bill_depth_mm |
Numeric | Depth of the bill in mm |
flipper_length_mm |
Numeric | Flipper length in mm |
body_mass_g |
Numeric | Body mass in grams |
sex |
Categorical | Male or Female |
Use the sidebar to:
- Adjust penguin measurements using sliders
- Select the penguin's sex and island
- Choose a classifier
- Click Predict to see the result