Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Machine Learning app App streamlit

This my first Machine Learning App

Demo App

Streamlit App

GitHub Codespaces

Open in GitHub Codespaces

๐Ÿง Penguin Species Prediction - Machine Learning App

Streamlit Python scikit-learn Pandas

An interactive web application that predicts penguin species using 8 different Machine Learning algorithms. Built with Streamlit for educational and research purposes.

๐Ÿ“‹ Table of Contents

๐ŸŽฏ Overview

This application demonstrates the power of Machine Learning for species classification using the famous Palmer Penguins dataset. Users can select from 9 different ML algorithms, adjust hyperparameters, and make real-time predictions with confidence scores.

Key Highlights

  • โœ… 8 ML Models: Compare Random Forest, SVM, Neural Networks, and more
  • โœ… Interactive UI: Intuitive interface with real-time predictions
  • โœ… Model Comparison: Automatic benchmarking of all algorithms
  • โœ… Performance Metrics: Detailed accuracy, cross-validation, and confusion matrices
  • โœ… Data Visualization: Interactive charts and correlation analysis
  • โœ… Educational: Perfect for learning ML classification techniques

๐Ÿš€ Features

1. Model Selection

Choose from 8 state-of-the-art classification algorithms:

  • ๐ŸŒณ Random Forest
  • ๐Ÿš€ Gradient Boosting
  • ๐ŸŽฏ Support Vector Machine (SVM)
  • ๐Ÿ‘ฅ K-Nearest Neighbors
  • ๐ŸŒฒ Decision Tree
  • ๐Ÿ“Š Logistic Regression
  • ๐ŸŽฒ Naive Bayes
  • โšก AdaBoost

2. Hyperparameter Tuning

  • Dynamically adjust model parameters
  • Real-time model retraining
  • Custom configurations for each algorithm

3. Real-Time Prediction

  • Interactive sliders for penguin features
  • Instant species prediction with confidence scores
  • Probability distribution visualization

4. Data Exploration

  • Complete dataset overview
  • Descriptive statistics
  • Species distribution analysis

5. Interactive Visualizations

  • Scatter plots with species coloring
  • Correlation matrices
  • Distribution analysis by species

6. Performance Evaluation

  • Accuracy scores (test and cross-validation)
  • Confusion matrix
  • Detailed classification report
  • Feature importance analysis
  • Training time metrics

7. Model Comparison

  • Automatic benchmarking of all 9 models
  • Side-by-side performance comparison
  • Medal ranking system ๐Ÿฅ‡๐Ÿฅˆ๐Ÿฅ‰
  • Recommendations for model selection

๐ŸŽฌ Demo

๐Ÿ”— Live Demo: https://machine-learningx.streamlit.app

App Preview App Preview

๐Ÿ’ป Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Steps

  1. Clone the repository
git clone https://github.com/SalaheddinE-ai/Machine-Learning.git
cd Machine-Learning
  1. Create a virtual environment (recommended)
python -m venv venv

# On Windows
venv\Scripts\activate

# On macOS/Linux
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
streamlit run streamlit_app.py

The app will open in your default browser at http://localhost:8501

๐Ÿ“ฆ Requirements

streamlit
pandas
numpy
scikit-learn

๐ŸŽฎ Usage

Quick Start

  1. Select a Model: Choose an ML algorithm from the sidebar
  2. Adjust Hyperparameters: Fine-tune model settings (optional)
  3. Input Penguin Features: Use sliders to set characteristics
    • Island location
    • Bill length and depth
    • Flipper length
    • Body mass
    • Sex
  4. View Prediction: See the predicted species with confidence score
  5. Explore Performance: Check accuracy and other metrics in the Performance tab
  6. Compare Models: Use the Model Comparison tab to find the best algorithm

Example Input

Island: Biscoe
Bill Length: 47.0 mm
Bill Depth: 15.0 mm
Flipper Length: 217.0 mm
Body Mass: 5000.0 g
Sex: Male

Predicted Species: Gentoo (95% confidence)

๐Ÿค– Machine Learning Models

Model Best For Speed Interpretability
๐ŸŒณ Random Forest General purpose Medium Medium
๐Ÿš€ Gradient Boosting High accuracy Slow Low
๐ŸŽฏ SVM Non-linear data Medium Low
๐Ÿ‘ฅ K-Nearest Neighbors Simple cases Fast High
๐ŸŒฒ Decision Tree Interpretability Fast Very High
๐Ÿ“Š Logistic Regression Linear relationships Very Fast Very High
๐ŸŽฒ Naive Bayes Large datasets Very Fast Medium
โšก AdaBoost Ensemble learning Medium Medium

๐Ÿ“Š Dataset

Palmer Penguins Dataset

  • Source: Palmer Station, Antarctica
  • Species: Adelie, Chinstrap, Gentoo
  • Features: 7 variables
  • Observations: 344 penguins
  • Islands: Biscoe, Dream, Torgersen

Variables

Variable Description Type
island Island where penguin was observed Categorical
bill_length_mm Length of the bill Numeric (mm)
bill_depth_mm Depth of the bill Numeric (mm)
flipper_length_mm Length of the flipper Numeric (mm)
body_mass_g Body mass Numeric (g)
sex Penguin sex Categorical
species Penguin species (target) Categorical

Dataset Credit: Palmer Penguins by Allison Horst

๐Ÿ› ๏ธ Technologies

Frontend

  • Streamlit: Interactive web interface
  • HTML/CSS: Custom styling

Backend & ML

  • Scikit-learn: Machine Learning algorithms
  • Pandas: Data manipulation
  • NumPy: Numerical computations

Data Visualization

  • Streamlit Charts: Native visualization components

๐Ÿ“ Project Structure

penguin-ml-prediction/
โ”‚
โ”œโ”€โ”€ streamlit_app.py          # Main application file
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ README.md                  # Project documentation
โ”‚
โ”œโ”€โ”€ .gitignore                 # Git ignore file
โ””โ”€โ”€ LICENSE                    # License file

๐Ÿ“ธ Screenshots

Prediction Tab

Prediction

Model Comparison

Comparison

Data Visualization

Visualization

๐ŸŽฏ Use Cases

  • Education: Learn and teach ML classification
  • Research: Experiment with different algorithms
  • Data Science: Prototype classification models
  • Biology: Study penguin species characteristics
  • ML Practice: Hands-on experience with real data

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Ideas for Contribution

  • Add more ML models
  • Implement additional visualizations
  • Add data preprocessing options
  • Create model export functionality
  • Improve UI/UX design
  • Add unit tests
  • Translate to other languages

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Your Name

Acknowledgments

  • Palmer Penguins Dataset: Allison Horst
  • Streamlit: For the amazing web framework
  • Scikit-learn: For comprehensive ML tools
  • Palmer Station, Antarctica: For collecting the penguin data

๐Ÿ“ˆ Future Enhancements

  • Add model persistence (save/load trained models)
  • Implement ensemble voting classifier
  • Add SHAP values for model explainability
  • Include ROC curves and AUC scores
  • Add batch prediction from CSV upload
  • Implement hyperparameter optimization (GridSearch)
  • Add model deployment guide
  • Create API endpoint for predictions

Known Issues

  • None currently reported

๐Ÿ’ฌ Support

If you have any questions or issues, please:

  1. Check existing Issues
  2. Open a new issue with detailed information
  3. Contact via email

โญ Star History

If you find this project useful, please consider giving it a star! โญ


Made with โค๏ธ and Python

Last Updated: November 2025

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages