Skip to content

Machine Learning algorithms implemented from scratch using Python. Covers both supervised and unsupervised learning with datasets and notebooks.

Notifications You must be signed in to change notification settings

ZohaibSattarDataAI/Machine-Learning-From-Scratch

Repository files navigation

🤖 Machine Learning From Scratch

Welcome to Machine Learning From Scratch — a comprehensive, beginner-friendly, and professional repository containing classic Machine Learning algorithms implemented in two ways:

From Scratch (Pure Python) — for complete understanding of the math and logic
With Scikit-learn — for production-ready and fast implementation

📌 This project includes only Machine Learning algorithms (no deep learning), with clean code, real datasets, and Jupyter notebooks for practice.


Machine Learning Algorithum

Link:Machine Learning From Scratch


🎯 Project Mission

To help students, developers, and AI enthusiasts learn Machine Learning the right way — by implementing core algorithms manually and then applying the same models using Scikit-learn for practical use.


🧠 Algorithms Included

Each folder includes:

  • Python code (from scratch)
  • Scikit-learn version
  • Dataset(s)
  • Jupyter notebook(s)

🔹 Supervised Learning

📈 Regression

  1. ✅ Simple Linear Regression
  2. ✅ Polynomial Linear Regression
  3. ✅ Multiple Linear Regression
  4. ✅ Lasso Regression
  5. ✅ Ridge Regression
  6. ✅ Random Forest Regression
  7. ✅ XGBoost Regressor (Scikit-learn version only)
  8. ✅ Decision Tree Regressor
  9. ✅ LightGBM Regressor
  10. ✅ CatBoost Regression
  11. ✅ ElasticNet Regression
  12. ✅ Bayesian Ridge Regression
  13. ✅ Gradient Boosting Regression
  14. ✅ Support Vector Machine (SVM) Regression
  15. ✅ K-Nearest Neighbors (KNN) Regression
  16. ✅ Huber Regression
  17. ✅ Orthogonal Matching Pursuit (OMP)
  18. ✅ Theil-Sen Regression
  19. ✅ Quantile Regression
  20. ✅ Tweedie Regression
  21. ✅ Principal Component Regression (PCR)
  22. ✅ Gamma Regression
  23. ✅ AdaBoost Regression
  24. ✅ Stepwise Regression
    • i) Forward Stepwise
    • ii) Backward Stepwise

🔍 Classification

  • ✅ Logistic Regression
  • ✅ Bernoulli Naive Bayes
  • ✅ Multinomial Naive Bayes
  • ✅ Naive Bayes Classification
  • ✅ Decision Tree Classification
  • ✅ K-Nearest Neighbors (KNN)
  • ✅ Support Vector Machine (SVM)
  • ✅ Random Forest Classifier (Scikit-learn only)

🔹 Unsupervised Learning

  • ✅ K-Means Clustering
  • ✅ Hierarchical Clustering
  • ✅ DBSCAN
  • ✅ PCA (Principal Component Analysis)
  • ✅ Apriori Algorithm (Association Rule Mining)
  • ✅ Frequent Pattern Growth (FP-Growth)


📘 Requirements

  • Python 3.x
  • NumPy, Pandas, Matplotlib, Seaborn
  • Scikit-learn (for sklearn versions only)

Install dependencies:

pip install numpy pandas matplotlib seaborn scikit-learn

💼 Use Cases

This repository is perfect for:

  • Students learning ML theory and code
  • Preparing for interviews and exams
  • Building data science portfolios
  • Training models with real datasets

🙌 Author

Zohaib Sattar
📧 Email: zabizubi86@gmail.com 🔗 LinkedIn: Zohaib Sattar


⭐️ Support the Project

If you find this project helpful, please ⭐️ star the repo and share it with your network. It motivates further open-source contributions!