CoolFace
Apppublic

hamzabenai/Incremental_learning_ML

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
App README

๐Ÿค– Incremental Learning Platform

An interactive web platform for training, retraining, and deploying machine learning models with incremental learning capabilities powered by River ML.

๐ŸŒŸ Features

  • โ€”๐ŸŽ“ Train New Models: Upload your dataset (CSV/XLSX) and train machine learning models from scratch
  • โ€”๐Ÿ”„ Retrain Existing Models: Update your models with new data while preserving previous knowledge (avoiding catastrophic forgetting)
  • โ€”๐ŸŽฏ Make Predictions: Generate predictions on new datasets using your trained models
  • โ€”๐Ÿ“Š Active Model Management: Seamlessly track and manage your current active model
  • โ€”๐Ÿ“ˆ Training History: View and manage your past training sessions
  • โ€”๐Ÿ’พ Model Persistence: Save and reload models for future use

๐Ÿ› ๏ธ Supported Models

Regression Models

  • โ€”Linear Regression: Simple linear regression for continuous targets
  • โ€”Random Forest Regressor: Ensemble method for robust regression tasks

Classification Models

  • โ€”Logistic Regression: Binary and multi-class classification
  • โ€”Random Forest Classifier: Ensemble classifier for complex classification problems

๐Ÿ“– How to Use

1๏ธโƒฃ Train a New Model

  1. 1.Navigate to the "Train New Model" tab
  2. 2.Upload your training data (CSV or XLSX format)
  3. 3.Select your target column (the variable you want to predict)
  4. 4.Choose identifier columns to exclude (optional)
  5. 5.Select the model type (Regressor or Classifier)
  6. 6.Click "Train Model"
  7. 7.Download your trained model or keep it active for retraining/predictions

2๏ธโƒฃ Retrain an Existing Model

  1. 1.Go to the "Retrain Model" tab
  2. 2.Upload new training data
  3. 3.Choose to use your active model or upload a different one
  4. 4.Click "Retrain Model"
  5. 5.Your model will learn from the new data while retaining previous knowledge

3๏ธโƒฃ Make Predictions

  1. 1.Navigate to the "Make Predictions" tab
  2. 2.Upload the data you want predictions for
  3. 3.Use your active model or upload a trained model
  4. 4.Click "Generate Predictions"
  5. 5.View results and download predictions as CSV

๐Ÿ”ง Technology Stack

  • โ€”Streamlit: Interactive web interface
  • โ€”River ML: Online/incremental machine learning framework
  • โ€”Pandas: Data manipulation and analysis
  • โ€”NumPy: Numerical computing
  • โ€”scikit-learn: Machine learning utilities and preprocessing
  • โ€”Altair: Declarative statistical visualizations

๐Ÿง  Incremental Learning

This platform uses incremental learning (also known as online learning), which allows models to:

  • โ€”Learn continuously from streaming data
  • โ€”Update without retraining from scratch
  • โ€”Avoid catastrophic forgetting using replay buffers
  • โ€”Handle concept drift in evolving data distributions

๐Ÿ“Š Data Requirements

Training Data

  • โ€”Format: CSV or XLSX
  • โ€”Structure: Tabular data with headers
  • โ€”Size: Any size (system automatically adjusts preprocessing based on dataset size)
  • โ€”Missing Values: Handled automatically based on data size and column characteristics

Prediction Data

  • โ€”Format: CSV or XLSX
  • โ€”Columns: Must match the features used during training (excluding target column)

๐ŸŽฏ Use Cases

  • โ€”Continuous Learning: Update models as new data arrives
  • โ€”A/B Testing: Train multiple model versions and compare
  • โ€”Real-time Predictions: Deploy models for instant predictions
  • โ€”Educational: Learn about incremental learning and online ML
  • โ€”Prototyping: Quickly test ML ideas without complex setup

๐Ÿ“ Example Workflow

1. Upload sales_data_2023.csv โ†’ Train RandomForestRegressor
2. Model achieves score of 0.85
3. New data arrives (sales_data_2024_q1.csv)
4. Retrain model with new data
5. Model score improves to 0.88
6. Upload unseen_customers.csv for predictions
7. Download predictions.csv with results

๐Ÿ”’ Privacy & Data

  • โ€”All data processing happens in your session
  • โ€”Models and data are not stored permanently on servers
  • โ€”Download your models to keep them for future use

๐Ÿค Contributing

This is an open-source educational project. Contributions, issues, and feature requests are welcome!

๐Ÿ“š Learn More

๐Ÿ“„ License

MIT License - feel free to use this project for learning and development!


Built with โค๏ธ using River ML and Streamlit