This repo is my personal effort to implement several supervised and unsupervised learning algorithms using only python and numpy. While directly using ML libraries is efficient at prototyping, it skips the challenges that arise while implementing these algorithms - vectorization is one good example for this. This has inspired me to implement these algorithms and tackle these challenges first-hand. I have used some ML libraries but solely for auxiliary tasks like normalization. This is a work in progress and I will add more algorithms over time.
Following is an example LDA projection.
This project requires python and the following python libraries.
- pandas
- numpy
- seaborn
- matplotlib
- scikit-learn
It also requires a software that can open and execute a Jupyter Notebook.
- Clone the repo or download using the url: https://github.com/intelaashish/Machine_Learning_Algorithms_Collection.git
- Download the corresponding necessary data from the web for each jupyter notebook file.
- Navigate to the directory that contains the corresponding notebook.
- Run the following command:
jupyter notebook
- This will open a tab on a web browser.
- Click on the notebook file corresponding to the machine learning method that you want to explore.
- kNN
a. Vanilla kNN
b. Priority Queue kNN - KD Tree
a. 1NN Search and Classification
b. kNN Search and Classification - Linear Regression
- Naive Bayes
a. Multinomial Naive Bayes
b. Gaussian Naive Bayes - Perceptron
- Support Vector Machines
a. Hard Margin SVM in Dual Form using QP Solver
b. Hard and Soft Margin SVM in Primal/ Natural form using Gradient Descent
- Dimensionality Reduction
a. PCA
b. LDA
PS: Some helper code in the repo could have been generated using Generative AI tools like ChatGPT. Nonetheless, the algorithm implementations were implemented by the owner from scratch.