Interactive data mining pipeline built with Streamlit — preprocessing, unsupervised clustering, PCA visualization, and evaluation metrics.
https://data-mining-project-cwjq4x39pan6yahegmyaxd.streamlit.app/
This app was developed as a mini-project for the FD1 (Fouille de Données 1) module at the Faculty of Computer Science, USTHB (M1 Bioinformatics, 2025–2026).
It provides a complete, interactive data mining pipeline covering:
- Volet 1 — Preprocessing: load, explore, clean, normalize, and visualize your dataset
- Volet 2 — Unsupervised Clustering: run 5 algorithms side-by-side, evaluate with silhouette score, and project results onto a 2D PCA plot
| Feature | Details |
|---|---|
| File import | CSV and Excel (.xlsx, .xls) |
| Overview metrics | Rows, columns, numeric cols, missing values, duplicates |
| Five-number summary | Min, Q1, Median, Q3, Max + Mean, Std, Mode |
| Missing value handling | Mean / Median / Mode imputation or row removal |
| Duplicate removal | One-click deduplication |
| Normalization | Min-Max [0,1] or Z-score (μ=0, σ=1) |
| Visualizations | Boxplot, Histograms, Correlation Heatmap, Scatter Matrix |
| Algorithm | Type | Notes |
|---|---|---|
| K-Means | Partitioning | Fast, centroid-based |
| K-Medoids | Partitioning | Manual implementation — uses real data points, robust to outliers |
| AGNES | Hierarchical (bottom-up) | Configurable linkage (Ward, Complete, Average, Single) + Dendrogram |
| DIANA | Hierarchical (top-down) | Divisive counterpart to AGNES |
| DBSCAN | Density-based | No k required, detects noise points, k-NN distance helper plot |
Additional features: Elbow curve, Silhouette score comparison, inertia bar chart, PCA 2D projections for all algorithms simultaneously.
git clone https://github.com/YOUR_USERNAME/fd1-data-mining.git
cd fd1-data-miningpip install -r requirements.txtstreamlit run app.pyThe interface opens automatically at http://localhost:8501
- Push this repository to GitHub (make sure
app.pyandrequirements.txtare at the root). - Go to share.streamlit.io and sign in with GitHub.
- Click "New app" → select your repo → set the main file to
app.py. - Click Deploy — your app will be live in ~2 minutes at a public URL.
Tip: The
.streamlit/config.tomlfile in this repo pre-configures the light theme and headless server mode for cloud deployment.
fd1-data-mining/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .streamlit/
│ └── config.toml # Streamlit theme & server config
└── README.md
| Dataset | Rows | Columns | Target |
|---|---|---|---|
| Heart Disease UCI | 303 | 14 | target (0/1) |
| Pima Indians Diabetes | 768 | 9 | Outcome |
| Iris | 150 | 5 | species |
| Library | Version | Purpose |
|---|---|---|
| Python | 3.10+ | Core language |
| Streamlit | ≥ 1.32 | Web UI framework |
| Pandas | ≥ 2.0 | Data manipulation |
| NumPy | ≥ 1.24 | Numerical computing |
| Scikit-learn | ≥ 1.3 | Clustering & preprocessing |
| Matplotlib | ≥ 3.7 | Charts & plots |
| Seaborn | ≥ 0.12 | Heatmaps |
| SciPy | ≥ 1.11 | Hierarchical linkage & dendrogram |
The K-Medoids algorithm was implemented from scratch without any external library, selecting real data points as cluster representatives to maximize robustness to outliers:
class KMedoids:
def fit_predict(self, X):
# Select initial medoids randomly
# Assign each point to nearest medoid
# Update medoids: pick point minimizing intra-cluster distances
# Repeat until convergence- Min-Max:
x' = (x - x_min) / (x_max - x_min) - Z-score:
x' = (x - μ) / σ
s(i) = (b(i) - a(i)) / max(a(i), b(i)) — ranges from −1 to +1, higher is better.
The app has 3 tabs:
- 🏠 Home — feature overview and usage guide
- 📂 Preprocessing — data loading, cleaning, normalization, visualization
- 🧩 Clustering — algorithm configuration, metrics, PCA projections
KHELIF Hadil — M1 Bioinformatics, USTHB
AI & Data Science Department
Academic year: 2025–2026
This project is released under the MIT License.