The roadmap I'd give to anyone starting ML from zero, built around short, free YouTube videos: one or two per phase, mostly StatQuest and freeCodeCamp, plus a few of Andrew Ng's Stanford CS229 lectures where you want the deeper math.
For students, fresh graduates, software engineers and data analysts who want a solid ML foundation. Realistic timeline: 8 weeks at 25–30 hours/week.
Phase 0 — Python & OOP (Week 1)
Everything after this is code, so this comes first.
Python basics and OOP
Data types, functions, comprehensions, files, classes, inheritance, dunder methods, virtual environments.
- Programming with Mosh, Python for Beginners, 1 hour
- Corey Schafer, Python OOP Tutorial 1: Classes and Instances
Math essentials (run alongside)
Vectors, matrices, dot product, derivatives, partial derivatives, chain rule. Gradients, regularization, SVM and PCA all rely on these.
Phase 0 project
Write a small Python package with classes (for example a Dataset class with mean(), std() and normalize() methods), set it up in a virtual environment, and add a README.
Phase 1 — Git & GitHub (Week 1)
Every project in this roadmap lives in a repository. Learn the workflow once, early, and use it for everything after this.
Version control essentials
Repositories, staging and commits, viewing history, undoing changes, branches and merging, remotes, pull requests, .gitignore, writing clear commit messages.
Phase 1 project
Put your Phase 0 package under version control. Commit in small steps with clear messages, add a .gitignore, work on a feature branch, open and merge a pull request, and push the repo to GitHub with a README.
Phase 2 — Software Principles: SOLID & Design Patterns (Week 2)
ML code that only works in a notebook does not survive contact with a team. This phase teaches you to structure code so it stays readable, testable and easy to change.
SOLID principles
Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion. Also: composition over inheritance, DRY, and keeping classes small and loosely coupled.
Design patterns
Creational (Factory, Singleton, Builder), structural (Adapter, Decorator, Facade) and behavioral (Strategy, Observer, Template Method). Strategy and Factory show up constantly in ML code, for example swapping models or preprocessors behind one interface, which is how scikit-learn estimators and pipelines are designed.
Phase 2 project
Refactor your Phase 0 package. Apply each SOLID principle at least once and say where in a short README section. Then implement two patterns, for example a Strategy for swappable normalizers (z-score, min-max) and a Factory that builds one from a config string.
Phase 3 — Probability & Statistics (Weeks 2-3)
Descriptive statistics, distributions, conditional probability, Bayes' theorem, CLT, hypothesis testing, p-values, confidence intervals, correlation. You need this for Naive Bayes, evaluation metrics and every "is this result real?" question.
- StatQuest, The Main Ideas behind Probability Distributions
- StatQuest, Hypothesis Testing and The Null Hypothesis
Phase 3 project
Take a real dataset, compute descriptive stats, plot distributions, and run one hypothesis test in Python. Write a short notebook explaining your conclusion.
Phase 4 — Web Scraping & Data Preparation (Week 3)
Most real ML time goes here, not into models.
Web scraping
requests, BeautifulSoup, Selenium basics.
NumPy, Pandas and visualization
Cleaning, EDA and feature engineering
Missing values, outliers, encoding, scaling, feature creation.
- freeCodeCamp, Web Scraping with Python and Beautiful Soup, crash course (1 hour)
- Keith Galli, Complete Python Pandas Data Science Tutorial (1 hour)
Phase 4 project
Scrape a dataset yourself (jobs, products, or news), clean it, run EDA, and save the result as a clean CSV in a GitHub repo.
Phase 5 — Overview of Machine Learning (Week 4)
Before any algorithm, learn how ML is done properly. Types of ML, train/validation/test split, overfitting and underfitting, bias-variance, cross-validation, the scikit-learn workflow and pipelines.
If you take only ONE thing from this phase, take this: bias-variance and cross-validation. Every later phase depends on them.
- StatQuest, Machine Learning Fundamentals: Bias and Variance
- StatQuest, Machine Learning Fundamentals: Cross Validation
Phase 5 project
Train your first model with a proper train/test split and cross-validation, wrapped in a scikit-learn Pipeline.
Phase 6 — Supervised Learning: Regression (Weeks 4-5)
Linear Regression
Simple and multiple regression, cost function, polynomial regression, MSE, RMSE, MAE, R².
Gradient Descent
Batch, stochastic and mini-batch. This is the idea behind almost all of ML training.
Regularization: Ridge, Lasso and Elastic Net
How to fight overfitting and select features.
- Andrew Ng, Stanford CS229, Lecture 2: Linear Regression and Gradient Descent (78 min)
- StatQuest, Ridge vs Lasso Regression, Visualized
Phase 6 project
Predict house prices. Implement gradient descent from scratch in NumPy, then compare with scikit-learn's Linear, Ridge, Lasso and ElasticNet.
Phase 7 — Supervised Learning: Classification (Weeks 5-6)
Suggested order, easiest to hardest: Metrics → KNN → Logistic Regression → Naive Bayes → Decision Trees → SVM.
Evaluation metrics
Confusion matrix, precision, recall, F1, ROC-AUC, PR curve, class imbalance.
KNN, Logistic Regression, Naive Bayes, Decision Trees, SVM
- StatQuest, Machine Learning Fundamentals: The Confusion Matrix
- StatQuest, ROC and AUC, Clearly Explained
- StatQuest, K-nearest neighbors, Clearly Explained
- Andrew Ng, Stanford CS229, Lecture 3: Locally Weighted and Logistic Regression (80 min)
- Andrew Ng, Stanford CS229, Lecture 5: GDA and Naive Bayes (79 min)
- Andrew Ng, Stanford CS229, Lecture 10: Decision Trees and Ensemble Methods (81 min, decision trees part)
- Andrew Ng, Stanford CS229, Lecture 6: Support Vector Machines (81 min)
- Andrew Ng, Stanford CS229, Lecture 7: Kernels (80 min, optional, SVM kernels in depth)
Phase 7 project
Build a classifier (Titanic or churn prediction). Compare all six algorithms with the same cross-validation and justify your best choice using the right metric, not just accuracy.
Phase 8 — Ensemble Models (Week 6)
Bagging, Random Forest, AdaBoost, Gradient Boosting, XGBoost/LightGBM, voting and stacking. On tabular data, these often beat everything else.
- Andrew Ng, Stanford CS229, Lecture 10: Decision Trees and Ensemble Methods (81 min, bagging and boosting part)
- StatQuest, XGBoost Part 1 (of 4): Regression
Phase 8 project
Take your Phase 7 dataset and beat your best single model with a tuned ensemble. Report the improvement honestly with cross-validation.
Phase 9 — Clustering, Hard and Soft (Week 7)
Hard clustering
K-Means (elbow, silhouette), Hierarchical clustering (dendrograms, linkage), DBSCAN.
Soft clustering
Gaussian Mixture Models, Expectation-Maximization, fuzzy C-means, choosing components with BIC/AIC.
- Andrew Ng, Stanford CS229, Lecture 13: Expectation-Maximization Algorithms (80 min, Gaussian mixtures, soft clustering)
- StatQuest, K-means clustering (8 min)
- StatQuest, Hierarchical Clustering
- StatQuest, Clustering with DBSCAN, Clearly Explained
Phase 9 project
Customer segmentation (Mall Customers dataset). Run K-Means, DBSCAN and GMM on the same data and explain how hard and soft assignments differ.
Phase 10 — Dimensionality Reduction (Week 7)
Curse of dimensionality, PCA, LDA, t-SNE (UMAP as a bonus).
- Andrew Ng, Stanford CS229, Lecture 14: EM Algorithm and Factor Analysis (80 min, dimensionality reduction)
- Andrew Ng, Stanford CS229, Lecture 16: Independent Component Analysis and RL (78 min, watch the ICA part)
- StatQuest, PCA main ideas in only 5 minutes
- StatQuest, t-SNE, Clearly Explained
- StatQuest, Linear Discriminant Analysis (LDA) clearly explained
Tip: apply PCA before clustering, then revisit Phase 9 and see what changes.
Phase 10 project
Visualize a high-dimensional dataset (MNIST or Wine) in 2D with PCA and t-SNE, then compare cluster quality before and after reduction.
Capstone Project
Pick a tabular dataset (for example from Kaggle), then combine everything: scrape or download data, clean it, run EDA, compare models with cross-validation, and add a clustering or dimensionality-reduction step. Publish it on GitHub with a clear README and a clean commit history.