This project is an implementation of various popular machine learning algorithms built entirely from scratch using Python. Each algorithm is implemented in its own file (e.g., DecisionTrees.py
) with a corresponding Jupyter notebook (train.ipynb
) for testing and training on sample datasets.
- Decision Tree - A tree-based model used for classification and regression tasks.
- K-Means Clustering - A popular unsupervised learning algorithm used for clustering tasks.
- K-Nearest Neighbors (KNN) - A simple, instance-based learning algorithm used for classification and regression.
- Linear Regression - A linear approach to modeling the relationship between a dependent variable and one or more independent variables.
- Logistic Regression - A statistical method for binary classification tasks.
- Naive Bayes - A probabilistic classifier based on Bayes' theorem.
- Principal Component Analysis (PCA) - A dimensionality reduction technique.
- Perceptron - One of the simplest types of artificial neural networks used for binary classification.
- Random Forest - An ensemble learning method based on decision trees for classification and regression tasks.
- Each algorithm is implemented without relying on high-level machine learning libraries, focusing on understanding the fundamental principles behind each technique.
- A
train.ipynb
notebook is provided to demonstrate how to train and test each algorithm with a sample dataset.
- Python 3.x
- Jupyter Notebook
- Required dependencies are listed in
requirements.txt
.
- Clone the repository:
git clone https://github.com/KacemMathlouthi/Machine-Learning-From-Scratch.git
- Navigate to the project directory:
cd Machine-Learning-From-Scratch
- Install the dependencies:
pip install -r requirements.txt
- Open the
train.ipynb
notebook in Jupyter, e.g. the KNN training notebook:jupyter notebook KNN/train.ipynb
- Follow the steps to test and train each algorithm on sample datasets.
.gitignore
: Lists files and directories to ignore in version control.requirements.txt
: Contains a list of required Python packages.README.md
: This file, providing an overview and usage guide for the project.
This project is licensed under the MIT License - see the LICENSE file for details.