“From scratch” is doing heavy lifting in that keyword. It usually means: no prior ML knowledge, maybe no programming, possibly no math background — and a desire for someone to lay out the entire path without assuming anything. That’s exactly what this is: the complete roadmap from absolute zero to building real machine learning systems, in the order that actually works.
I’ve seen hundreds of learners attempt this journey. The ones who succeed aren’t the smartest — they’re the ones who followed a sane sequence instead of bouncing between random tutorials. Randomness is the enemy. Here’s the sequence. For how this fits the bigger AI picture, see my guide on how to learn artificial intelligence.
Table of Contents
- What “From Scratch” Really Requires
- Phase 0: Prerequisites (Don’t Skip)
- Phase 1: Python for ML (Weeks 1–4)
- Phase 2: Math Intuition (Weeks 3–6, Overlapping)
- Phase 3: Core ML Concepts (Weeks 5–10)
- Phase 4: The Algorithm Toolkit (Weeks 8–14)
- Phase 5: Real Projects (Weeks 12–20)
- What Comes After: The Fork
- Frequently Asked Questions

What “From Scratch” Really Requires
Let’s be honest about the starting line. “From scratch” in ML means:
- Time: 1 hour daily minimum, for 4–6 months. Less than that and concepts decay between sessions.
- A computer: any modern laptop works. You don’t need a GPU for classical ML — that comes later, if ever.
- Tolerance for confusion: you will feel lost regularly. That’s the process working, not failing. Confusion is the feeling of your mental models updating.
- No prerequisites beyond high-school math and basic computer comfort. Everything else is built along the way.
What it doesn’t require: a degree, a math background, or genius. It requires showing up.
Phase 0: Prerequisites (Don’t Skip)
Before touching ML, get these two things in place. Skipping them is the #1 cause of early quitting.
Basic computer fluency. You should be comfortable installing software, using the terminal for basic commands, and managing files. If “open a terminal” makes you nervous, spend a weekend on a command-line basics tutorial first.
High-school math comfort. Not mastery — comfort. You should recognize what a function is, read a graph, and not panic at basic algebra. If it’s been decades, a week of Khan Academy algebra refresher pays for itself many times over.
That’s it. Don’t spend months “preparing.” Two weeks max, then move — you’ll learn the rest just-in-time.
Phase 1: Python for ML (Weeks 1–4)
Python is the language of ML, no debate. But you don’t need all of Python — you need the ML-relevant subset:
Weeks 1–2: Core Python. Variables, data types, loops, conditionals, functions, lists/dicts, basic OOP (just enough to use libraries). Any “Python for beginners” course works; move fast through parts that aren’t ML-relevant.
Weeks 3–4: The data stack. NumPy (numerical arrays — the foundation everything is built on), pandas (data manipulation — you’ll live in this), matplotlib/seaborn (visualization — essential for understanding your data). Learn these by doing: load real datasets, poke at them, plot everything.
The test for moving on: can you load a CSV, clean it a bit, compute some statistics, and make a few plots without following a tutorial line-by-line? If yes, your Python is sufficient. You’ll keep improving it forever, but it’s enough to start ML.
Phase 2: Math Intuition (Weeks 3–6, Overlapping)
Learn this alongside Python, not before. The goal is intuition, not computation:
Linear algebra essentials: what vectors and matrices are, what matrix multiplication does geometrically. 3Blue1Brown’s “Essence of Linear Algebra” — first half — is perfect. You need the feel, not the proofs.
Statistics essentials: mean/median/mode, variance, distributions (especially normal), correlation. You’ll use these constantly when exploring data. Khan Academy statistics is sufficient.
Calculus teaser: understand what a derivative represents (rate of change) and what gradient descent does conceptually (walk downhill to find the lowest error). The full details come later; the intuition comes now. This connects directly to how AI models are trained.
One hour of math for every three hours of coding is about the right ratio at this stage.

Phase 3: Core ML Concepts (Weeks 5–10)
Now the actual machine learning begins. These concepts underpin everything:
The ML workflow: framing a problem, getting data, splitting train/validation/test, training, evaluating, iterating. This workflow is 80% of real ML work, and beginners massively underestimate it while over-focusing on algorithms.
Supervised vs. unsupervised: learning from labeled examples (classification, regression) versus finding structure in unlabeled data (clustering). Know which type every problem is before reaching for algorithms.
Overfitting and generalization: the central drama of ML. Your model must perform on new data, not just the data it trained on. Understand bias-variance tradeoff, and learn the weapons against overfitting: cross-validation, regularization, and simply getting more data.
Evaluation metrics: accuracy is rarely the right metric. Learn precision, recall, F1, ROC-AUC for classification; MAE, RMSE, R² for regression. Know which metric matters for which problem — this is what separates practitioners from tutorial-followers.
Feature engineering: the art of representing your data well. Often matters more than algorithm choice. Learn to create, select, and transform features.
Phase 4: The Algorithm Toolkit (Weeks 8–14)
Learn these in order, implementing each on a real dataset:
- Linear & logistic regression — the simplest models, and the foundation for understanding everything else. If you can’t explain these cold, you’re not ready to move on.
- Decision trees — intuitive, visual, and the building block for the next two.
- Random forests — your first “just works” algorithm. Ensemble thinking starts here.
- Gradient boosting (XGBoost/LightGBM) — the workhorse of applied ML. Wins competitions, solves business problems, deserves deep study.
- SVMs and k-NN — less central than they once were, but the concepts (margins, distance-based learning) are worth knowing.
- Clustering (k-means, hierarchical) — your unsupervised toolkit.
- Dimensionality reduction (PCA) — for visualization and preprocessing.
For each: understand when to use it, what its key parameters do, and how to tell if it’s working. The scikit-learn documentation plus Géron’s book is the ideal combination here.
Phase 5: Real Projects (Weeks 12–20)
This phase is where learning becomes skill. Three projects, increasing in independence:
Project 1: Guided replication (weeks 12–14). Take a well-documented ML project (Kaggle has thousands) and rebuild it yourself, understanding every step. You’re learning the shape of a complete project.
Project 2: Real dataset, your choices (weeks 14–17). Pick a dataset you care about. Make your own decisions about preprocessing, algorithms, and evaluation. It’ll be messier than the guided project — that’s the point. Document everything in a GitHub repo with a real README.
Project 3: End-to-end with deployment (weeks 17–20). Build something with a simple web interface (Streamlit or Gradio make this easy). A model nobody can use is a demo; a deployed model is a product. This project becomes your portfolio centerpiece.
Write up each project as if explaining to a hiring manager: problem, approach, results, what you’d do differently. That writeup is as valuable as the code.
What Comes After: The Fork
At ~5 months, you face the fork:
Applied path: deepen deployment skills, learn MLOps basics, study domain-specific applications. Target: ML engineer / data scientist roles. Your portfolio of shipped projects is your credential.
Deep learning path: PyTorch, neural networks, then CNNs/transformers. Target: roles involving unstructured data or current research-level AI. Heavier math, bigger payoff in certain markets.
Specialist path: NLP, computer vision, or reinforcement learning. Pick the one that excites you; depth in one area beats shallow coverage of all three.
All three paths build on everything above. None of them require starting over. For context on the tools landscape you’ll be working in, my overview of AI tools explained maps what’s out there.
That’s the whole road: prerequisites, Python, math intuition, core concepts, algorithms, projects, then your chosen fork. It’s 4–6 months of real work — not a weekend, not a year of drifting. Start today, follow the sequence, build constantly, and you’ll be shocked how far “from scratch” can go.

Frequently Asked Questions
Start with Python basics (4 weeks), add math intuition alongside (linear algebra and statistics basics), then learn core ML concepts and algorithms with scikit-learn over 2-3 months. Build real projects from week 12 onward. Total: 4-6 months of daily effort from zero to competent.
You need intuition (not computation) for linear algebra (vectors, matrices), statistics (distributions, correlation), and basic calculus concepts (derivatives, gradient descent). Learn these alongside coding, just-in-time, rather than as a separate prerequisite phase.
Yes, effectively. Python is the universal language of ML — every major library (scikit-learn, PyTorch, TensorFlow) is Python-first. The good news: you only need the ML-relevant subset, which takes about 4 weeks to learn, not full software-engineering Python.
With an hour of daily focused effort: 4-6 months from zero to building and deploying real ML systems. Prior programming experience shortens this by 1-2 months. Consistency matters far more than total hours — daily practice beats weekend marathons.
Progress through three stages: (1) rebuild a well-documented project to learn the shape of ML work, (2) tackle a real dataset with your own choices and document it on GitHub, (3) deploy an end-to-end model with a web interface using Streamlit or Gradio. Each should be written up as a portfolio piece.




