Skip to content

pointer2Alvee/machine-learning-algorithms-scratch

Repository files navigation

Image 1 Image 2

📜 machine-learning-algorithms-scratch

🧠 Overview

Comprehensive Machine Learning concepts & algorithms implemented from scratch using Python & numpy only. This repository is a collection of core machine learning algorithms built without any external ML libraries like Scikit-learn or TensorFlow. The goal is to gain a deep understanding of how these algorithms work under the hood — mathematically and programmatically.

🎯 Use Cases

  • Implementing ML algorithms/models from scratch
  • Learning the mathematical mehanism behind ML algorithms
  • Learning the foundations of machine learning
  • Teaching aid for ML courses
  • Interview preparation

🟢 Project Status

  • Current Version: V1.0

📃 Repository Structure

machine-learning-algorithms-scratch/
├── assets/
│   └── images/
├── datasets/
│   ├── various datasets
│   └── in (.csv/.json/.xlsx) format files
├── supervised/
│   ├── classification
│   │   ├── decision-tree
│   │   ├── knn
│   │   ├── logistic-regression
│   │   ├── naive-bayes
│   │   ├── random-forest
│   │   └── svm
│   └── regression/
│   │   ├── decision-tree
│   │   ├── linear-regression
│   │   └── random-forest
├── unsupervised/
│   │   ├── clustering
│   │   │   ├── kmc
│   │   ├── dimensionality-reduction
│   │   │   ├── pca
│   │   │   └── lda
│   │   ├── association-rule-learning
│   │   └── anomaly-detection
├── semi-supervised
├── README
└── .gitignore                  # gitignore file

✨ Features

  • Covers supervised, unsupervised and semi-supervised ML algorithms
  • Pure Python and NumPy — no ML libraries
  • Modular, clean, and reusable code
  • Educational and beginner-friendly

🚀 Getting Started

  • Knowledge Required : python, linear algebra, probability, statistics, numpy, matplotlib
💻 Software Requirements
  • IDE (VS Code) or jupyter notebook or google colab
  • Python 3

🛡️ Tech Stack

  • Python 💻
  • Numpy, Pandas, Matplotlib, Scikit-Learn🧩

⚙️ Installation

git clone https://github.com/yourusername/machine-learning-algorithms-scratch.git
cd ml-algorithms-scratch 

📖 Usage

  • Open .ipynb files inside each algorithm directory and run them to see training/inference steps, plots, and results.

🧪 Algorithms Implemented

  • ✅ Supervised-Classification :- Logistic-Regression, SVM, KNN, Naive-Bayes, Decision-Tree, Random-Forest

  • ✅ Supervised-Regression :- LR, MLR, Decision-Tree, Random-Forest

  • ✅ Unsupervised-Clustering :- KMC

  • ✅ Unsupervised-DimenReduction :- PCA

  • ⏳ Upcoming : LDA, Adaboost, SVM (SVR & non-linear SVM, kernel-trick), GBM, Neural-Network from scratch, Perceptron

🧭 Roadmap

  • Implement raw ML algorithms from scratch
  • Re-implement ML algorithms using tensorflow
  • Re-implement ML algorithms using scikit-learn
  • Re-implement ML algorithms using pyTorch

🤝 Contributing

Contributions are welcomed!

  1. Fork the repo.
  2. Create a branch: git checkout -b feature/YourFeature
  3. Commit changes: git commit -m 'Add some feature'
  4. Push to branch: git push origin feature/YourFeature
  5. Open a Pull Request.

📜License

Distributed under the MIT License. See LICENSE.txt for more information.

🙏Acknowledgements

  • Special thanks to the open-source community / youtube for tools and resources.

About

Core Machine Learning concepts , algorithms & maths implemented completely from scratch using Python & numpy only.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published