A comprehensive, interview-ready, and portfolio-level ML repository covering algorithms from basic to advanced — with theory, math, implementation, and analysis for every algorithm.
ML-Algorithms-Repository/
│
├── Supervised_Learning/
│ ├── Linear_Regression/
│ ├── Logistic_Regression/
│ ├── Decision_Trees/
│ ├── Random_Forest/
│ ├── Support_Vector_Machine/
│ ├── K_Nearest_Neighbors/
│ ├── Naive_Bayes/
│ └── Gradient_Boosting/
│
├── Unsupervised_Learning/
│ ├── K_Means_Clustering/
│ ├── DBSCAN/
│ ├── Hierarchical_Clustering/
│ └── Gaussian_Mixture_Models/
│
├── Dimensionality_Reduction/
│ ├── PCA/
│ ├── LDA/
│ └── t_SNE/
│
├── Ensemble_Methods/
│ ├── Bagging/
│ ├── Boosting_AdaBoost/
│ └── XGBoost/
│
├── Reinforcement_Learning/
│ ├── Q_Learning/
│ └── Policy_Gradient/
│
├── Optimization_Algorithms/
│ ├── Gradient_Descent/
│ ├── Adam_Optimizer/
│ └── Genetic_Algorithm/
│
└── Neural_Networks/
├── Perceptron/
├── MLP_Backpropagation/
└── CNN_Basics/
| File | Description |
|---|---|
README.md |
Full concept explanation, math, use cases, pros/cons, complexity |
implementation.py |
From-scratch Python + NumPy implementation |
visualization.py |
Plots and graphs (where applicable) |
- Linear Regression → Logistic Regression → KNN → Naive Bayes
- K-Means Clustering → PCA
- Decision Trees → Random Forest → SVM
- Gradient Descent → Adam Optimizer
- DBSCAN → Hierarchical Clustering
- Gradient Boosting → AdaBoost → XGBoost
- Perceptron → MLP Backpropagation → CNN Basics
- Q-Learning → Policy Gradient
- t-SNE → LDA
pip install numpy matplotlib scikit-learn pandas seabornAll core implementations use only NumPy (no sklearn for the algorithm itself).
| Algorithm | Time (Train) | Time (Predict) | Space |
|---|---|---|---|
| Linear Regression | O(n·d²) | O(d) | O(d²) |
| Logistic Regression | O(n·d·i) | O(d) | O(d) |
| Decision Tree | O(n·d·log n) | O(log n) | O(n) |
| Random Forest | O(t·n·d·log n) | O(t·log n) | O(t·n) |
| SVM | O(n²–n³) | O(sv·d) | O(sv) |
| KNN | O(1) | O(n·d) | O(n) |
| K-Means | O(n·k·i·d) | O(k·d) | O(n+k) |
| PCA | O(n·d²) | O(d·k) | O(d²) |
git clone https://github.com/yourusername/ML-Algorithms-Repository
cd ML-Algorithms-Repository
python Supervised_Learning/Linear_Regression/implementation.pyBuilt for learning, interviews, and portfolio showcase.