18 core machine-learning algorithms — explained, derived, and built from scratch. One notebook per topic: the intuition, the maths, and a fully worked example on a real dataset, side-by-side with the scikit-learn version. Run any of them in your browser with one click — zero setup.
- 🧠 Theory and practice — every algorithm covers the intuition, the underlying mathematics (cost functions, optimisation, key formulas), and a real worked example.
- 🛠️ From scratch + scikit-learn — see the algorithm implemented from first principles, then how you'd actually use it in practice.
- 📊 Real datasets & proper evaluation — the right metrics and plots for each problem,
not just
.fit()/.score(). ▶️ Zero setup — one-click Open in Colab on every notebook, orpip install -r requirements.txtto run locally.- 🎯 Great for self-taught learners, students, and interview prep — a single, consistent path from linear regression to anomaly detection.
Work through the topics in order — each builds on the previous ones. Click Colab to run a notebook in the browser with zero setup.
| # | Topic | Notebook | Run | Status |
|---|---|---|---|---|
| 1 | Linear Regression | 01_linear_regression.ipynb | ✅ Done | |
| 2 | Ridge, Lasso & ElasticNet | 02_ridge_lasso_elasticnet.ipynb | ✅ Done | |
| 3 | Logistic Regression | 03_logistic_regression.ipynb | ✅ Done | |
| 4 | Support Vector Machines (SVM) | 04_svm.ipynb | ✅ Done | |
| 5 | Naive Bayes | 05_naive_bayes.ipynb | ✅ Done | |
| 6 | K-Nearest Neighbor (KNN) | 06_knn.ipynb | ✅ Done | |
| 7 | Decision Tree | 07_decision_tree.ipynb | ✅ Done |
| # | Topic | Notebook | Run | Status |
|---|---|---|---|---|
| 8 | Random Forest | 08_random_forest.ipynb | ✅ Done | |
| 9 | AdaBoost | 09_adaboost.ipynb | ✅ Done | |
| 10 | Gradient Boosting | 10_gradient_boosting.ipynb | ✅ Done | |
| 11 | XGBoost | 11_xgboost.ipynb | ✅ Done |
| # | Topic | Notebook | Run | Status |
|---|---|---|---|---|
| 12 | Unsupervised ML (overview) | 12_unsupervised_overview.ipynb | ✅ Done | |
| 13 | Principal Component Analysis (PCA) | 13_pca.ipynb | ✅ Done | |
| 14 | K-Means Clustering | 14_kmeans.ipynb | ✅ Done | |
| 15 | Hierarchical Clustering | 15_hierarchical_clustering.ipynb | ✅ Done | |
| 16 | DBSCAN Clustering | 16_dbscan.ipynb | ✅ Done | |
| 17 | Silhouette Analysis | 17_silhouette_analysis.ipynb | ✅ Done | |
| 18 | Anomaly Detection | 18_anomaly_detection.ipynb | ✅ Done |
- Concept & intuition — what the algorithm does and why
- The mathematics — cost functions, optimisation, key formulas
- Assumptions / requirements
- A real dataset — chosen to showcase the algorithm
- EDA — understanding the data first
- Training with scikit-learn
- Evaluation with the right metrics and plots
- From scratch (where it deepens understanding)
- Pros, cons & when to use
- Summary
# Install dependencies
pip install -r requirements.txt
# Launch Jupyter and open a notebook
jupyter notebookDatasets are a mix of scikit-learn / seaborn built-ins (zero setup) and real-world datasets where they make a more compelling example. Local data files live in data/.
ML-Algorithms/
├── 01-linear-regression/
│ └── 01_linear_regression.ipynb
├── 02-ridge-lasso-elasticnet/
├── 03-logistic-regression/
├── ... # one folder per topic, 01 … 18
├── 18-anomaly-detection/
├── data/ # local datasets (most come from sklearn/seaborn)
├── assets/ # shared images + generate_gallery.py (README banner)
├── requirements.txt
├── CONTRIBUTING.md
├── LICENSE
└── README.md
Done: all 18 classical algorithms above. Planned / ideas (contributions welcome — see below):
- Time-series forecasting (ARIMA, Prophet)
- Neural networks from scratch (MLP, backprop)
- Model selection & cross-validation deep-dive
- Feature engineering & pipelines
- A shared "datasets" cheatsheet
⭐ Star the repo to follow along as new topics land.
Found a typo, a clearer explanation, or want to add a topic from the roadmap? PRs and issues are very welcome — see CONTRIBUTING.md.
Released under the MIT License.
