A repository where I recreate some popular machine learning models from scratch in Python for educational purposes.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This repository is for educational purposes. While the efficiency of the code or completeness is not as good as the one you could find in a library like sklearn, the simplification of the algorithm allows you to really understand how the algorithm works, and why it's being used for a particular dataset.
Every subfolder contains a file demo.ipynb, which contains a practical application of the algorithm. It loads a dataset, perform a basic EDA, and fits the model.
Moreover, I published an article explaining in granular details every model present in this repo. I highly recommend reading them, as I go through on how the model works, the math behind the model, its benefits, assumptions, and cons, and most importantly, a breakdown and explanation of the code to build it.
- AdaBoost
- Adam
- Batch Normalization
- CART
- Convolutional Neural Networks
- Deep CNN - AlexNet
- ID3 - Decision Tree
- K-Means Clustering
- KNN
- LSTM
- Nadam Optimizer
- Naive Bayes Classifier
- Neural Networks
- Fine-Tuning Deep Neural Networks
- Principal Component Analysis
- Random Forest
- Recurrent Neural Networks
- Stochastic Gradient Descent
- Support Vector Classfier
- XGBoost
Follow these steps to get a local copy up and running:
-
Clone the repository:
git clone https://github.com/cristianleoo/models-from-scratch-python.git
-
Install Python packages. You can use pip or conda, depending on your setup:
pip install -r requirements.txt
-
(Optional) Run the tests to verify that everything is set up correctly:
python -m unittest discover
Now, you're ready to use the repository!