Spaces:
Sleeping
Sleeping
File size: 3,861 Bytes
9f6ab4d facf506 9f6ab4d facf506 9f6ab4d facf506 9f6ab4d facf506 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | ---
title: Data2Model
emoji: π
colorFrom: indigo
colorTo: red
sdk: docker
app_port: 7860
pinned: false
license: mit
short_description: Upload data, train models, deploy instantly
tags:
- machine-learning
- automl
- flask
- scikit-learn
- classification
- regression
- clustering
---
# π Data2Model
**Automated Machine Learning Pipeline β From Raw Data to Deployable Web App**
Upload a dataset β Configure preprocessing β Train models β Download a ready-to-deploy prediction app
---
## β¨ Features
| Feature | Description |
|---|---|
| **One-Click AutoML** | Upload CSV/Excel/JSON and automatically train & compare 8+ ML algorithms |
| **Smart Type Detection** | Automatically distinguishes numeric vs categorical columns with manual override |
| **Per-Column Preprocessing** | Configure scaling (Standard, MinMax, Robust, Normalizer) and encoding (One-Hot, Label, Ordinal, Binary) individually per column |
| **Flexible Null Handling** | Per-column imputation: mean, median, mode, custom constant, or row deletion |
| **Column Dropping** | Exclude irrelevant columns (IDs, timestamps, etc.) before training |
| **Flexible Data Splits** | Train/Test or Train/Test/Validation with configurable percentages |
| **Data Dashboard** | Auto-generated visualizations: histograms, correlation heatmaps, distributions |
| **Deployable App Export** | Download a complete Flask web app (ZIP) with your trained model built-in |
| **Prediction Interface** | Upload new data for batch predictions with a trained model |
| **Auto Cleanup** | Uploaded datasets are automatically deleted after training and on server shutdown |
## π§ Supported Algorithms
### Classification
Logistic Regression Β· Random Forest Β· Gradient Boosting Β· Decision Tree Β· KNN Β· Naive Bayes Β· SVM Β· AdaBoost Β· XGBoost Β· LightGBM
### Regression
Linear Regression Β· Random Forest Β· Gradient Boosting Β· Decision Tree Β· KNN Β· SVR Β· AdaBoost Β· XGBoost Β· LightGBM
### Unsupervised
K-Means Β· DBSCAN Β· Agglomerative Clustering Β· PCA
---
## π§ How to Use
1. **Upload** β Drop your CSV, Excel, or JSON dataset
2. **Configure** β Set null handling, scaling, encoding, and column selection per column
3. **Train** β Choose problem type, target column, and data split strategy
4. **Evaluate** β View metrics (Accuracy, F1, RΒ², RMSE) and preprocessing summary
5. **Deploy** β Download the trained model or a complete Flask prediction app (ZIP)
## π Project Structure
```
βββ app.py # Flask web application
βββ model_pipeline.py # AutoML pipeline engine
βββ Dockerfile # Container configuration for HF Spaces
βββ requirements.txt # Python dependencies
βββ templates/ # Jinja2 HTML templates
β βββ base.html # Base layout
β βββ index.html # Home / upload page
β βββ configure.html # Preprocessing & training config
β βββ result.html # Training results & metrics
β βββ predict.html # Prediction interface
β βββ ... # About, docs, feedback, error pages
βββ static/ # CSS & JavaScript
βββ uploads/ # Temporary uploads (auto-cleaned)
βββ saved_models/ # Trained models & deployable ZIPs
```
## π‘οΈ Data Privacy
- Uploaded datasets are **never stored permanently**
- Files are deleted immediately after training completes
- All remaining uploads are wiped on server shutdown
---
## π» Run Locally
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/Data2Model
cd Data2Model
pip install -r requirements.txt
python app.py
```
Open **http://localhost:5000** in your browser.
---
<p align="center">
Built with β€οΈ using Flask & scikit-learn
</p>
|