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>