hamzabenai/Incremental_learning_ML
0
๐ค 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
- Navigate to the "Train New Model" tab
- Upload your training data (CSV or XLSX format)
- Select your target column (the variable you want to predict)
- Choose identifier columns to exclude (optional)
- Select the model type (Regressor or Classifier)
- Click "Train Model"
- Download your trained model or keep it active for retraining/predictions
2๏ธโฃ Retrain an Existing Model
- Go to the "Retrain Model" tab
- Upload new training data
- Choose to use your active model or upload a different one
- Click "Retrain Model"
- Your model will learn from the new data while retaining previous knowledge
3๏ธโฃ Make Predictions
- Navigate to the "Make Predictions" tab
- Upload the data you want predictions for
- Use your active model or upload a trained model
- Click "Generate Predictions"
- 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
