Implementation of machine learning algorithms from scratch for learning purposes. PyTorch is the only dependency. Scikit-learn and Matplotlib are used in the example.py
file to compare the scikit-learn implementations with the custom made implementations and give examples on how to use the components. However, the library itself only depends on PyTorch.
- torch (2.4.0)
- [Optional] : scikit-learn (1.5.1)
Clone the project and use algorithms. The example.py
file shows how to use the algorithms.
pip install torch==2.4.0
git clone git@github.com:GM07/MLAlgorithms.git
cd MLAlgorithms
- Linear Regression
- Ridge Regression
- Lasso Regression
- Logistic Regression
- KMeans
- DBSCAN
- Gaussian Naive Bayes
- Bernoulli Naive Bayes
- Multinomial Naive Bayes
- PCA
- t-SNE
- UMAP
- Decision Tree Classifier
- Decision Tree Regressor
- Bagging
- Boosting
- XGBoost
- Random Forests
- Linear Layer
- Attention Layer
- Convolutional Layer
- Max Pooling Layer
- Average Pooling Layer
- Layer Normalization Layer
- Batch Normalization Layer
- Neural Network
- LSTM
- RNN
- Transformer
- Diffusion Model
- RMSE
- Scikit-learn: Machine Learning in Python, Pedregosa et al., JMLR 12, pp. 2825-2830, 2011.