ML algorithms implemented from scratch using R
This repository contains machine learning algorithm implementations built from the ground up in R, focusing on understanding the mathematical foundations and core concepts behind each algorithm.
- Learn by Building: Understand ML algorithms by implementing them from scratch
- Mathematical Foundation: Focus on the math and logic behind each algorithm
- Clean R Code: Well-documented, readable R implementations
- Educational Resource: Serve as a learning tool for ML enthusiasts
- Linear Regression (Simple & Multiple)
- Logistic Regression
- K-Nearest Neighbors (KNN)
- Naive Bayes
- Binary Decision Tree
- Full Recursive Decision Tree
- Random Forest
- Support Vector Machine (SVM)
- K-Means Clustering
- Principal Component Analysis (PCA)
- Linear Discriminant Analysis (LDA)
- Perceptron
- AdaBoost
- Neural Network
This project uses the following R packages:
tidyverse- For data manipulation and visualizationdplyr- For data wranglingggplot2- For plotting and visualizationdata- Default Built in datsets of R
# Install required packages
install.packages(c("tidyverse", "dplyr", "ggplot2", "datasets", "caret"))This repository is designed for:
- Students learning machine learning fundamentals
- Practitioners wanting to understand algorithms deeply
- R Enthusiasts interested in ML implementation
- Anyone curious about the math behind ML
This is a personal learning project, but suggestions and improvements are welcome! Feel free to:
- Open issues for bugs or suggestions
- Submit pull requests for improvements
- Share feedback on implementations
Important: These implementations are for educational purposes.
Built with R for learning Machine Learning from scratch