Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML-Algorithms

License: MIT Python 3.9+ Notebooks scikit-learn PRs welcome Stars

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.

Gallery of plots produced across the notebooks

Why this repo?

  • 🧠 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, or pip install -r requirements.txt to run locally.
  • 🎯 Great for self-taught learners, students, and interview prep — a single, consistent path from linear regression to anomaly detection.

Curriculum

Work through the topics in order — each builds on the previous ones. Click Colab to run a notebook in the browser with zero setup.

Supervised Learning

# Topic Notebook Run Status
1 Linear Regression 01_linear_regression.ipynb Open In Colab ✅ Done
2 Ridge, Lasso & ElasticNet 02_ridge_lasso_elasticnet.ipynb Open In Colab ✅ Done
3 Logistic Regression 03_logistic_regression.ipynb Open In Colab ✅ Done
4 Support Vector Machines (SVM) 04_svm.ipynb Open In Colab ✅ Done
5 Naive Bayes 05_naive_bayes.ipynb Open In Colab ✅ Done
6 K-Nearest Neighbor (KNN) 06_knn.ipynb Open In Colab ✅ Done
7 Decision Tree 07_decision_tree.ipynb Open In Colab ✅ Done

Ensemble Methods

# Topic Notebook Run Status
8 Random Forest 08_random_forest.ipynb Open In Colab ✅ Done
9 AdaBoost 09_adaboost.ipynb Open In Colab ✅ Done
10 Gradient Boosting 10_gradient_boosting.ipynb Open In Colab ✅ Done
11 XGBoost 11_xgboost.ipynb Open In Colab ✅ Done

Unsupervised Learning

# Topic Notebook Run Status
12 Unsupervised ML (overview) 12_unsupervised_overview.ipynb Open In Colab ✅ Done
13 Principal Component Analysis (PCA) 13_pca.ipynb Open In Colab ✅ Done
14 K-Means Clustering 14_kmeans.ipynb Open In Colab ✅ Done
15 Hierarchical Clustering 15_hierarchical_clustering.ipynb Open In Colab ✅ Done
16 DBSCAN Clustering 16_dbscan.ipynb Open In Colab ✅ Done
17 Silhouette Analysis 17_silhouette_analysis.ipynb Open In Colab ✅ Done
18 Anomaly Detection 18_anomaly_detection.ipynb Open In Colab ✅ Done

Each notebook follows the same structure

  1. Concept & intuition — what the algorithm does and why
  2. The mathematics — cost functions, optimisation, key formulas
  3. Assumptions / requirements
  4. A real dataset — chosen to showcase the algorithm
  5. EDA — understanding the data first
  6. Training with scikit-learn
  7. Evaluation with the right metrics and plots
  8. From scratch (where it deepens understanding)
  9. Pros, cons & when to use
  10. Summary

Getting started

# Install dependencies
pip install -r requirements.txt

# Launch Jupyter and open a notebook
jupyter notebook

Datasets 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/.

Project structure

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

Roadmap

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.

Contributing

Found a typo, a clearer explanation, or want to add a topic from the roadmap? PRs and issues are very welcome — see CONTRIBUTING.md.

License

Released under the MIT License.

About

18 core ML algorithms explained from scratch + scikit-learn — intuition, math, and runnable Colab notebooks.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages