In an era where trends like Neural Networks, NLP, and Retrieval-Augmented Generation (RAG) dominate, building a strong foundation in core machine learning concepts is more important than ever. This series is dedicated to creating some of the most common and widely used machine learning models from scratch.
Each implementation is designed to be simple, clean, and easy to understand, making it ideal for learning and practical use. I hope you find it helpful! 😊
- Linear Regression
- Logistic Regression
- Decision Tree
- Random Forest
- K Nearest Neighbors
- Support Vector Machine
- KMeans Clustering
Before running the models, make sure to install the required dependencies.
Run the following command:
pip install -r requirements.txt
Each model is placed in its own directory. Navigate to the respective directory to execute the model.
cd <model_directory_name>
Example:
cd 01_Linear_Regression
After navigating to the model directory, execute the train.py
file to train the model.
python train.py
ML_Models_From_Scratch/
│
├── 01_Linear_Regression/
│ ├── train.py
| ├── results/
│ ├── src/
| ├── linear_regression.py
│
├── 02_Logistic_Regression/
│ ├── train.py
| ├── data/
│ ├── src/
| ├── logistic_regression.py
| ├── metrics.py
│
├── 03_Decision_Tree/
│ ├── train.py
│ ├── src/
| ├── Node.py
| ├── DecisionTree.py
|
├── 04_Random_Forest/
│ ├── train.py
│ ├── src/
| ├── Node.py
| ├── DecisionTree.py
| ├── RandomForest.py
|
├── 05_KNN/
│ ├── train.py
│ ├── src/
| ├── KNN.py
|
├── 06_SVM/
│ ├── train.py
│ ├── src/
| ├── SVM.py
|
├── 07_KMeans_Clustering/
│ ├── train.py
│ ├── src/
| ├── KMeans.py
│
├── .gitignore
├── requirements.txt
└── README.md
If you have any questions, suggestions, or feedback, feel free to reach out! 😊