How to Learn Machine Learning: A Complete 2027 Roadmap From Zero
A free, staged path for learning machine learning from scratch: the math you actually need, Python and data skills, classical ML, deep learning, transformers and LLMs, and how to ship models, with time estimates, best-pick courses and books, projects, and answers to the questions beginners search for.
Last reviewed: December 2026
If you want to learn machine learning from zero, the hardest part is not any single concept. It is choosing what to study, in what order, and when you know enough to move on. This guide answers that. It lays out a machine learning roadmap in six stages, recommends one “best pick” resource per stage (almost all free), explains what to skip, and gives you projects that prove each skill. It assumes no prior ML knowledge, only the willingness to write code and work through some math.
Paid resources are marked (paid). Free books listed here are hosted by their authors or publishers.
Table of Contents
- What Machine Learning Is (and Is Not)
- The Roadmap at a Glance
- Stage 0: Programming and Tools (3-6 weeks)
- Stage 1: The Math You Need (4-8 weeks, in parallel)
- Stage 2: Data Skills (2-4 weeks)
- Stage 3: Classical Machine Learning (6-10 weeks)
- Stage 4: Deep Learning (8-12 weeks)
- Stage 5: Transformers, LLMs and Generative Models (6-10 weeks)
- Stage 6: ML Engineering and Deployment (ongoing)
- Courses Compared
- Books Compared
- Tools and Libraries
- Datasets and Practice Platforms
- Projects by Stage
- Sample Weekly Schedules
- Choosing a Specialization
- Common Mistakes
- FAQ
- Where to Go Next
- Contributing
What Machine Learning Is (and Is Not)
Machine learning is writing programs whose behavior is learned from data rather than spelled out by hand. You pick a model family (linear model, decision tree, neural network), a loss that measures how wrong it is, and an optimizer that adjusts parameters to reduce the loss on examples. The core skill is not knowing many algorithms; it is knowing how to frame a problem, prepare data, evaluate honestly, and diagnose failure.
| Term | What people usually mean |
|---|---|
| Artificial intelligence | The broad goal of machines doing tasks that seem to need intelligence |
| Machine learning | Learning behavior from data |
| Deep learning | ML with multi-layer neural networks |
| Data science | Using data (statistics, ML, visualization) to answer questions and drive decisions |
| Generative AI / LLMs | Deep learning models that generate text, images, audio or code |
| ML engineering | Building, deploying and maintaining ML systems in production |
The main learning types:
- Supervised learning: inputs with labels (spam / not spam, house price). Most practical ML.
- Unsupervised learning: structure without labels (clustering, dimensionality reduction).
- Self-supervised learning: labels derived from the data itself (predict the next word). How LLMs are pretrained.
- Reinforcement learning: learning from rewards through interaction. See Reinforcement Learning Resources.
The Roadmap at a Glance
| Stage | You learn | Time at ~10 h/week | Best pick (free unless marked) | Proof you’re done |
|---|---|---|---|---|
| 0. Programming | Python, Git, notebooks, command line | 3-6 weeks | Python tutorial + Kaggle Learn Python | Write a 200-line script that parses a CSV and prints a report |
| 1. Math | Linear algebra, calculus, probability, statistics | 4-8 weeks (parallel) | Mathematics for Machine Learning + 3Blue1Brown | Derive the gradient of linear regression’s loss by hand |
| 2. Data | NumPy, pandas, plotting, cleaning | 2-4 weeks | Kaggle Learn pandas + visualization | Clean and explore a messy real dataset |
| 3. Classical ML | Regression, trees, ensembles, evaluation | 6-10 weeks | ISLP + scikit-learn user guide | Beat a baseline on a tabular Kaggle competition with honest CV |
| 4. Deep learning | Neural nets, backprop, CNNs, training tricks | 8-12 weeks | fast.ai + Neural Networks: Zero to Hero | Train an image classifier and a tiny language model from scratch |
| 5. Transformers and LLMs | Attention, fine-tuning, RAG, evaluation | 6-10 weeks | Hugging Face LLM Course + Understanding Deep Learning | Fine-tune a small model and evaluate it properly |
| 6. ML engineering | Serving, monitoring, pipelines | ongoing | Made With ML + MLOps Zoomcamp | A deployed model with an API, tests and monitoring |
Total: about 8-14 months part-time to be job-ready for junior ML / data roles; faster if you already program.
Stage 0: Programming and Tools (3-6 weeks)
ML is a programming discipline first. You need fluent Python.
Learn:
- Python basics: types, control flow, functions, classes, list/dict comprehensions, modules, virtual environments.
- Jupyter notebooks or Google Colab (free, runs in the browser with GPUs).
- Git and GitHub basics.
- The command line: navigating folders, running scripts, installing packages.
Resources:
| Resource | Cost | Notes |
|---|---|---|
| The Python Tutorial (official) | Free | Accurate and complete; best reference |
| Kaggle Learn: Python | Free | Short, interactive, ML-oriented |
| CS50’s Introduction to Programming with Python | Free (paid certificate optional) | Structured lectures and problem sets |
| Automate the Boring Stuff with Python | Free online | Practical, beginner friendly |
| Pro Git book | Free | Git reference |
| The Missing Semester (MIT) | Free | Shell, editors, Git, debugging |
If you are completely new to programming, follow How to Learn Programming first.
Stage 1: The Math You Need (4-8 weeks, in parallel)
You do not need a math degree. You need working intuition in four areas, and you should study them alongside Stages 2-3 rather than delaying everything until the math is “done”.
| Area | What you actually use | Best free resource |
|---|---|---|
| Linear algebra | Vectors, matrices, matrix multiplication, dot products, eigenvectors, SVD (for PCA) | 3Blue1Brown: Essence of Linear Algebra, then MIT 18.06SC |
| Calculus | Derivatives, partial derivatives, the chain rule, gradients | 3Blue1Brown: Essence of Calculus |
| Probability | Random variables, distributions, expectation, Bayes’ rule | Harvard Statistics 110 lectures, Seeing Theory |
| Statistics | Sampling, confidence intervals, hypothesis tests, bias/variance | Khan Academy Statistics and Probability |
| All of the above for ML | Everything tied together with ML examples | Mathematics for Machine Learning (free book) |
Best pick: 3Blue1Brown videos for intuition, then Mathematics for Machine Learning chapters 2-6 as reference. Do exercises with code: implement matrix multiplication, numerical gradients and sampling in NumPy.
Minimum checklist:
- Multiply matrices by hand and explain shapes.
- Compute the gradient of
(y - wx)^2with respect tow. - Explain why the mean of many samples gets close to the expectation.
- Explain overfitting in terms of bias and variance.
Stage 2: Data Skills (2-4 weeks)
Most real ML work is data work.
Learn: NumPy arrays and broadcasting, pandas DataFrames (filtering, grouping, joins, missing values), plotting with Matplotlib or Seaborn, basic SQL.
| Resource | Notes |
|---|---|
| Kaggle Learn: Pandas, Data Visualization, Data Cleaning, Intro to SQL | Free, hands-on micro-courses |
| pandas documentation and user guide | The 10-minute intro and user guide are excellent |
| NumPy: the absolute basics for beginners | Official, concise |
| Python Data Science Handbook | Free online; older (2016) but the NumPy/pandas/Matplotlib chapters remain useful |
Exercise: pick a public dataset (city open data, a sports dataset, the UCI ML Repository), and answer five questions about it with tables and plots. Write down every data quality problem you find.
Stage 3: Classical Machine Learning (6-10 weeks)
This is where you learn how ML actually works: fitting, validating, comparing.
Core topics, in order:
| Week | Topic | Key ideas |
|---|---|---|
| 1 | The ML workflow | Train/validation/test split, baselines, metrics |
| 1-2 | Linear and logistic regression | Loss functions, gradient descent, regularization (L1/L2) |
| 3 | Model evaluation | Cross-validation, precision/recall, ROC-AUC, calibration, data leakage |
| 4 | k-nearest neighbors, naive Bayes | Distance, probabilistic classifiers |
| 4-5 | Decision trees, random forests | Splits, bagging, feature importance |
| 5-6 | Gradient boosting | XGBoost, LightGBM, CatBoost: the strongest models for tabular data |
| 7 | Support vector machines, kernels | Margins (understand the idea; used less today) |
| 8 | Unsupervised learning | k-means, hierarchical clustering, PCA, t-SNE/UMAP |
| 9 | Feature engineering and pipelines | Encoding, scaling, scikit-learn Pipeline and ColumnTransformer |
| 10 | Putting it together | End-to-end project with a written report |
Best picks:
- Book: An Introduction to Statistical Learning (ISLP, Python edition), free PDF from the authors. Clear, rigorous, with labs.
- Course (paid certificate, can often be audited): Machine Learning Specialization by DeepLearning.AI and Stanford on Coursera. Very beginner friendly. (paid) for certificate.
- Course (free, more mathematical): Stanford CS229, with lecture notes online and lecture videos on Stanford Online’s YouTube channel.
- Course (free, excellent intuition): Cornell CS4780 Machine Learning for Intelligent Systems, lecture notes and recorded lectures.
- Course (free, theory foundations): Learning From Data (Caltech).
- Library docs: the scikit-learn user guide is itself a high-quality textbook.
- Visual explainers: MLU-Explain (interactive articles) and StatQuest (videos).
Reference for later: The Elements of Statistical Learning, the more advanced sibling of ISL, also free from the authors.
Implement from scratch at least once: linear regression with gradient descent, logistic regression, k-means, a decision tree. Then switch to scikit-learn for real work.
Stage 4: Deep Learning (8-12 weeks)
Core topics:
- Neurons, layers, activations, the forward pass.
- Backpropagation and automatic differentiation.
- Optimizers (SGD, momentum, Adam), learning-rate schedules.
- Regularization: dropout, weight decay, data augmentation, early stopping.
- Normalization (batch norm, layer norm) and initialization.
- Convolutional networks for images; transfer learning.
- Sequence models: embeddings, RNNs briefly, then attention.
- Training practice: debugging loss curves, overfitting a single batch, mixed precision, checkpoints.
Best picks (choose a top-down and a bottom-up resource):
| Resource | Style | Cost | Why |
|---|---|---|---|
| Practical Deep Learning for Coders (fast.ai) | Top-down: build first, theory later | Free | Fastest route to training real models |
| Neural Networks: Zero to Hero | Bottom-up: build autograd and a GPT from scratch | Free | Deepest intuition per hour of any resource |
| Dive into Deep Learning (d2l.ai) | Interactive book with runnable code | Free | Broad, code-first, PyTorch/JAX/TensorFlow |
| MIT 6.S191 Introduction to Deep Learning | Short lecture bootcamp + labs | Free | Fast, current overview; runs every January |
| Deep Learning Specialization | Structured MOOC | (paid) certificate | Clear explanations of fundamentals |
| Stanford CS231n | University course (vision) | Free materials | Gold standard for CNNs and backprop intuition |
| PyTorch tutorials | Official docs | Free | The framework most courses and research use |
Books:
- Understanding Deep Learning by Simon Prince (2023), free PDF from the author. Modern, beautifully illustrated, includes transformers and diffusion. Best pick.
- Deep Learning: Foundations and Concepts by Christopher and Hugh Bishop (2024), with a free online version on the book’s site; print is (paid).
- Deep Learning by Goodfellow, Bengio and Courville (2016), free online. Still strong on fundamentals; dated on architectures.
- Probabilistic Machine Learning (Books 1 and 2) by Kevin Murphy, free PDFs from the author. Encyclopedic reference.
- Hands-On Machine Learning with Scikit-Learn and PyTorch by Aurelien Geron (O’Reilly, 2025) (paid). Practical bridge from scikit-learn to PyTorch; notebooks on the author’s site.
Framework choice: learn PyTorch first. It dominates research and most open-source models. JAX is worth learning later for research at scale; Keras/TensorFlow remain in some production stacks.
Stage 5: Transformers, LLMs and Generative Models (6-10 weeks)
Topics:
- Tokenization and embeddings.
- Attention and the transformer architecture.
- Pretraining vs fine-tuning; instruction tuning; parameter-efficient fine-tuning (LoRA).
- Using models through APIs and open weights; prompting.
- Retrieval-augmented generation (RAG) and embeddings search.
- Evaluation: benchmarks, held-out test sets, LLM-as-judge pitfalls.
- Preference tuning and RL (RLHF, DPO, GRPO) at a conceptual level.
- Diffusion models for images.
Resources:
| Resource | Cost | Notes |
|---|---|---|
| Hugging Face LLM Course | Free | Transformers library, datasets, fine-tuning, practical |
| The Illustrated Transformer | Free | Best visual intro to attention |
| 3Blue1Brown: Neural Networks series | Free | Includes visual chapters on transformers and attention |
| nanoGPT | Free code | Train a small GPT; read every line |
| LLMs-from-scratch | Free code | Companion code to Build a Large Language Model (From Scratch) by Sebastian Raschka (Manning, (paid) book) |
| Speech and Language Processing (3rd ed. draft) | Free | Jurafsky and Martin’s NLP textbook, updated drafts online |
| Understanding Deep Learning ch. 12-18 | Free | Transformers, GANs, flows, VAEs, diffusion |
| DeepLearning.AI short courses | Free (at time of review) | One-to-two-hour practical courses on specific tools |
Best pick: build nanoGPT (or follow Zero to Hero’s GPT lecture), then the Hugging Face course for practical fine-tuning.
Stage 6: ML Engineering and Deployment (ongoing)
Models that never leave a notebook rarely matter. Learn to ship.
Topics: experiment tracking, reproducible environments, data versioning, model serving (REST APIs with FastAPI), containers (Docker), batch vs online inference, monitoring and drift, CI/CD for ML, cost and latency trade-offs.
| Resource | Cost | Notes |
|---|---|---|
| Made With ML | Free | End-to-end MLOps with code |
| MLOps Zoomcamp | Free | Cohort-based or self-paced, project-graded |
| Machine Learning Zoomcamp | Free | Practical ML engineering course including deployment |
| Full Stack Deep Learning | Free | Lectures on building ML-powered products (recorded 2022-2023) |
| Designing Machine Learning Systems by Chip Huyen (O’Reilly) | (paid) | Best book on production ML decisions |
| MLflow, Weights & Biases | Free / freemium | Experiment tracking |
See also How to Learn System Design for the distributed-systems side.
Courses Compared
| Course | Level | Math depth | Coding | Cost | Best for |
|---|---|---|---|---|---|
| Machine Learning Specialization (Coursera) | Beginner | Low-medium | Guided labs | (paid) certificate | Absolute beginners who like structure |
| Kaggle Learn | Beginner | Low | Hands-on | Free | Fast practical start |
| Google ML Crash Course | Beginner | Low-medium | Interactive | Free | Quick conceptual overview |
| Microsoft ML for Beginners | Beginner | Low | scikit-learn lessons | Free | Classroom-style 12-week curriculum |
| ISLP book + labs | Beginner-intermediate | Medium | Python labs | Free | Statistical understanding |
| Stanford CS229 | Intermediate | High | Problem sets | Free materials | Mathematical foundations |
| Cornell CS4780 | Intermediate | Medium-high | Projects | Free materials | Intuition with rigor |
| fast.ai | Beginner-intermediate | Low then medium | Heavy | Free | Practical deep learning |
| Zero to Hero | Intermediate | Medium | Heavy, from scratch | Free | Deep understanding of neural nets and GPTs |
| d2l.ai | Intermediate | Medium | Heavy | Free | Reference course-book |
| CS231n | Intermediate-advanced | Medium-high | Assignments | Free materials | Vision and backprop |
| MIT 6.S191 | Beginner-intermediate | Medium | Colab labs | Free | One-week overview |
| Hugging Face LLM Course | Intermediate | Low-medium | Heavy | Free | Applied NLP and LLMs |
Books Compared
| Book | Free? | Level | Best for |
|---|---|---|---|
| Mathematics for Machine Learning | Free PDF | Beginner-intermediate | Math foundations tied to ML |
| An Introduction to Statistical Learning (Python) | Free PDF | Beginner | First ML textbook |
| The Elements of Statistical Learning | Free PDF | Advanced | Statistical depth |
| Understanding Deep Learning | Free PDF | Intermediate | Modern deep learning |
| Dive into Deep Learning | Free online | Intermediate | Code-first deep learning |
| Deep Learning (Goodfellow et al.) | Free online | Intermediate-advanced | Classic fundamentals |
| Deep Learning: Foundations and Concepts | Free online version | Intermediate-advanced | Rigorous modern treatment |
| Probabilistic Machine Learning | Free PDFs | Advanced | Comprehensive reference |
| Python Data Science Handbook | Free online | Beginner | NumPy/pandas/Matplotlib |
| Hands-On Machine Learning with Scikit-Learn and PyTorch | (paid) | Beginner-intermediate | Practical, project-driven |
| Designing Machine Learning Systems | (paid) | Intermediate | Production ML |
| Build a Large Language Model (From Scratch) | (paid) | Intermediate | LLM internals in PyTorch |
If you read only three: ISLP, Understanding Deep Learning, and (paid) Hands-On Machine Learning.
Tools and Libraries
| Category | Tool | Why |
|---|---|---|
| Language | Python | The ecosystem is here |
| Arrays | NumPy | Foundation for everything |
| Data frames | pandas, Polars | Tabular data; Polars is a fast alternative |
| Classical ML | scikit-learn | Consistent API, pipelines, evaluation |
| Gradient boosting | XGBoost, LightGBM, CatBoost | Best for tabular data |
| Deep learning | PyTorch | Research and industry standard |
| Alternatives | JAX, Keras | Research at scale; high-level API |
| Pretrained models | Hugging Face Transformers | Thousands of open models |
| Notebooks | Jupyter, Google Colab, Kaggle Notebooks | Exploration; free GPUs on Colab/Kaggle |
| Experiment tracking | MLflow, Weights & Biases | Compare runs reproducibly |
| Serving | FastAPI, Docker | Put a model behind an API |
Datasets and Practice Platforms
| Platform | Use it for |
|---|---|
| Kaggle Competitions | Real problems, leaderboards, public notebooks to learn from |
| Kaggle Datasets | Practice datasets on every topic |
| UCI Machine Learning Repository | Classic, small, well-documented datasets |
| Hugging Face Datasets | Text, image, audio datasets ready to load |
| OpenML | Benchmarked tabular datasets and tasks |
| Google Dataset Search | Find datasets across the web |
Projects by Stage
| Stage | Project | What it proves |
|---|---|---|
| 2 | Exploratory analysis of a public dataset with a written summary | Data cleaning, visualization, communication |
| 3 | House price regression with a proper train/validation/test protocol | Regression, leakage awareness |
| 3 | Customer churn classifier with precision/recall trade-off analysis | Classification metrics, thresholds |
| 3 | Kaggle tabular competition: beat your own baseline with gradient boosting | Feature engineering, cross-validation |
| 3 | Customer segmentation with k-means and PCA | Unsupervised learning |
| 4 | Image classifier with transfer learning (e.g., plant diseases) | CNNs, augmentation |
| 4 | Micrograd and makemore-style models from scratch | Backprop and autograd understanding |
| 5 | Fine-tune a small transformer for text classification | Hugging Face workflow |
| 5 | RAG question-answering over your own documents, with an evaluation set | Embeddings, retrieval, evaluation |
| 5 | Train a tiny GPT on a text corpus | Transformer internals |
| 6 | Deploy one of the above as an API in Docker with logging and a monitoring dashboard | ML engineering |
Portfolio advice: three finished, well-documented projects beat ten half-done notebooks. Each should have a README with the problem, data, baseline, method, results with error bars or validation scores, and what you would do next.
Sample Weekly Schedules
10 hours/week (working full-time):
| Day | Activity |
|---|---|
| Mon, Wed | 1.5 h course lectures/reading |
| Tue, Thu | 1.5 h coding exercises |
| Sat | 3 h project work |
| Sun | 1 h review notes, flashcards on concepts |
25+ hours/week (full-time learner): half the time on a course/book, a third on projects, the rest on math and reading other people’s Kaggle notebooks and code.
Choosing a Specialization
After Stage 4, specialize. Employers hire for depth in one area plus solid foundations.
| Path | Focus | Next resources |
|---|---|---|
| Data scientist | Statistics, experimentation, classical ML, communication | ISLP, A/B testing material, SQL |
| ML engineer | Production systems, MLOps, performance | Made With ML, MLOps Zoomcamp, system design |
| Computer vision | CNNs, ViTs, detection, segmentation | CS231n, timm |
| NLP / LLM engineer | Transformers, fine-tuning, RAG, agents, evaluation | HF LLM Course, SLP3, nanoGPT |
| Research | Math depth, reading and reproducing papers | Murphy’s PML, CS229, arXiv |
| Reinforcement learning | Sequential decisions, control | Reinforcement Learning Resources |
Common Mistakes
- Waiting to finish all the math before coding. Learn math just ahead of where you need it.
- Tutorial hopping. Pick one course per stage and finish it.
- Evaluating on training data or leaking test information. The most common reason “great” models fail.
- Skipping baselines. Always compare to a dumb model (predict the mean, majority class, a linear model).
- Jumping to deep learning for tabular data. Gradient boosting usually wins there.
- Only copying notebooks. Re-implement key pieces yourself, then use libraries.
- Ignoring data quality. More time on data usually beats more time on models.
- Not writing anything down. Explaining your project is part of the skill.
FAQ
Can I learn machine learning without a degree? Yes. Every core resource here is free and open. Employers look for demonstrated skill: projects, code, write-ups and, for research roles, papers. A degree helps for research positions and some visa or HR filters, but many ML engineers are self-taught or switched from software engineering.
How long does it take to learn machine learning? At about 10 hours a week, roughly 3-4 months to be comfortable with classical ML, 6-8 months to be solid in deep learning, and around a year to be competitive for junior roles. Prior programming experience can cut this substantially.
Do I need to be good at math for machine learning? You need comfort with linear algebra, derivatives, and probability. You do not need advanced proofs for applied roles. Research roles need much more.
Python or R for machine learning? Python. R remains strong in statistics and some research fields, but Python dominates ML tooling, deep learning and industry jobs.
PyTorch or TensorFlow? PyTorch for learning and most new work. Learn TensorFlow/Keras if your job requires it; the concepts transfer.
Is machine learning still worth learning with LLMs everywhere? Yes. Building, adapting, evaluating and deploying LLM systems requires ML fundamentals: data, evaluation, overfitting, training dynamics, and cost trade-offs. People who understand the fundamentals debug these systems much faster.
Do I need a GPU? Not at first. Classical ML runs on any laptop. For deep learning, free GPUs on Google Colab and Kaggle are enough for learning.
Which is the best course for machine learning beginners? For a structured, gentle start: the Machine Learning Specialization on Coursera (paid certificate) or the free Google ML Crash Course. For learn-by-doing: Kaggle Learn then fast.ai. For understanding: ISLP plus CS229 notes.
What is the difference between data science and machine learning? Data science is broader: asking questions of data, statistics, visualization, and communicating results. ML is the modeling toolkit, which data scientists use and ML engineers productionize.
How do I get my first ML job? Build 3 strong projects, contribute to an open-source ML library or write technical blog posts, practice ML interview topics (fundamentals, coding, ML system design), and target adjacent roles (data analyst, software engineer on an ML team) as stepping stones. Chip Huyen’s free ML Interviews Book explains the process.
Where to Go Next
- Reinforcement Learning Resources: agents, rewards, PPO and RL for LLMs.
- How to Learn System Design: build systems that serve models at scale.
- How to Learn Web Development: put a frontend on your models.
- Read papers: arXiv cs.LG recent and Hugging Face Papers for trending research.
- Explanations of research: Distill (archived but excellent) and Transformer Circuits for interpretability.
Contributing
Suggestions are welcome via issues and pull requests. Please include:
- A real, working link (free books must be legally hosted by authors or publishers).
- Level, cost (mark paid resources), and what it is best for.
- Which stage it belongs in.
Reports of broken links or outdated information are especially appreciated.
If this helped you, a star helps others find it.
More free resources
Part of the Ralpberry Labs open-source collection. See also Top 100 Open Source.