An open API service indexing awesome lists of open source software.

https://github.com/pointer2alvee/machine-learning-algorithms-scratch

Core Machine Learning concepts , algorithms & maths implemented completely from scratch using Python & numpy only.
https://github.com/pointer2alvee/machine-learning-algorithms-scratch

machine-learning-algorithms numpy pandas probabilistic-machine-learning python statistical-models

Last synced: 5 months ago
JSON representation

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

Awesome Lists containing this project

README

          


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
- [x] 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.