Blog · Machine learning

Where to start with machine learning: a four-step path for beginners

Start machine learning with Python, then NumPy and pandas, the maths a model uses, and linear regression. A four-step path for beginners, with checkpoints.

Start machine learning with Python, not with a model. Learn in four steps: (1) core Python, (2) the data tools NumPy, pandas, Matplotlib and scikit-learn, (3) the maths and statistics that explain what a model does, and (4) classical machine learning, beginning with linear regression and gradient descent and moving to classification and evaluation. Steps 3 and 4 overlap: learn each piece of maths right before the model that needs it. Move to the next step when you can pass its checkpoint without copying code, not when you finish a set number of videos.

That is the order we recommend for machine learning beginners, and the rest of this post gives each step's topics, a rough time estimate and a checkpoint. It is only about the order of learning machine learning itself. If you are still deciding between AI fields, including generative AI applications, read how to learn AI from scratch. If you already know you want the job, and want to know what comes after the learning (deployment, a portfolio, applying), read the machine learning engineer roadmap.

How to start machine learning in four steps

Most people who stall in machine learning don't lack effort. They learn things in the wrong order. Some start with a deep learning tutorial and copy code they cannot change. Others spend months on linear algebra textbooks and never train a model, and lose momentum. Both problems have the same cause: each step depends on the one before it, and skipping a step leaves you unable to tell whether your results are right.

Step What you learn Checkpoint
1. Python The language, files, errors, tests Count the ten most common words in a text file, with a test for the counting function
2. Data tools NumPy, pandas, Matplotlib, the scikit-learn API Load a table, average one column per group, plot it, and fit a model against a baseline
3. Maths and statistics Vectors, matrices, derivatives, distributions, probability Read a model's formula aloud and explain what each symbol means
4. Classical ML Regression, gradient descent, classification, evaluation Implement linear regression from scratch and match scikit-learn's coefficients

The checkpoints come from the SchoolWhool learning path, which orders every lesson across the five course tracks into stages, each ending with a task to complete.

If you only need to read model reports without coding, see machine learning for non-technical people. The four steps below are the route into building and evaluating models yourself. To compare courses that teach them, see the best machine learning course for your starting point.

Step 1: Learn Python, the way ML code uses it

Learn variables and types, if and loops, lists and dictionaries, strings, functions, modules, reading files, handling errors, and writing a simple test. Learn classes well enough to read model.fit(X, y). You do not need web frameworks, decorators or metaclasses to start.

You can skip this step if you can already write a function that loops over a list and returns a result. Otherwise, the free Python track starts from zero; its first lesson, Why Python?, explains why machine learning runs on Python and where code is written and run. For a detailed list of what to learn and what to skip, see Python for machine learning.

Checkpoint: read a text file, count how often each word appears using a dictionary, and print the ten most common words. Write a pytest test for the counting function.

Rough time: 3 to 4 weeks at about 7 hours a week, from zero.

Step 2: Learn the four data tools

Machine learning is mostly data handling. Before a model sees anything, the data has to be loaded, cleaned, reshaped and looked at. The Data Tools track covers the four libraries in order:

  1. NumPy for arrays: shapes, indexing, boolean masks and broadcasting.
  2. pandas for tables: selecting, filtering, cleaning missing values and groupby, all in the pandas module.
  3. Matplotlib for charts, because you should look at data before modeling it.
  4. scikit-learn for models: every model shares the same fit, predict and score interface, as the scikit-learn API module shows by scoring a first model against a do-nothing baseline.

This is also the right time to run a complete model end to end, even before you understand its insides. Machine learning code in Python walks through a full 31-line example. Seeing the whole workflow early gives the maths in step 3 something to attach to.

Aim to think in arrays rather than loops, and to make a chart that answers a question, not just a chart that exists.

Checkpoint: load a CSV with pandas, compute the average of one column per group, plot it, and fit a scikit-learn model that beats a baseline on a held-out test set.

Rough time: 2 to 3 weeks.

Step 3: Learn the maths and statistics a model uses

You need a specific, limited set of ideas, set out in detail in prerequisites for machine learning:

  • Maths: functions and logarithms, reading ML notation, vectors and the dot product, matrices and the matrix–vector product, derivatives and the gradient. The Maths track covers these, each shown on a picture first.
  • Statistics: describing a distribution, spread, correlation and confounding, who is (and is not) in a dataset, probability and Bayes' theorem. The Statistics track covers these, starting with why statistics matters. Statistics is the part beginners most often skip, and regret: skip it and you'll train models fine, then draw the wrong conclusions from them.

Do not try to finish step 3 before starting step 4. You don't need a semester of calculus to understand gradient descent. Learn enough to read a formula like ŷᵢ = Σⱼ wⱼ xᵢⱼ in words, then start models and come back for each new idea as a model needs it: vectors right before nearest-neighbour methods, derivatives right before gradient descent, matrices right before multiple features, Bayes' theorem right before Naive Bayes, log loss right before logistic regression. Using each piece the moment you learn it is what makes it stick.

Checkpoint: explain, in plain words, what a dot product computes, what the sign of a derivative tells you, and why the median can describe a skewed feature better than the mean.

Step 4: Learn classical machine learning, starting with regression

Begin with the model that teaches the most per hour: linear regression trained by gradient descent. It brings together everything from steps 1 to 3: a prediction is a dot product, the error is a function of the weights, and the derivative tells you which way to move them. The Machine Learning track starts its regression module with three lessons:

  1. Linear regression, explained geometrically.
  2. Gradient descent, the method that trains most models, including neural networks.
  3. Gradient descent for linear regression, step by step.

Build that first model yourself, with gradient descent in NumPy, before you lean on the library. This one exercise teaches more than ten tutorials that call model.fit(): what a loss is, what a gradient does, and why the learning rate matters.

After regression comes the most important stage, and the one most courses rush: knowing whether a model works. That means a train/test split and why you touch the test set only once, cross-validation, overfitting and regularisation, and precision, recall, ROC curves and choosing a threshold from real costs. Everything after it is another model evaluated the same way. Get this stage right and you can learn any algorithm; get it wrong and no algorithm will save you.

The order that works from there: a first classifier (k-nearest neighbours), then evaluation as above, then linear classifiers such as logistic regression, then preparing real data (missing values, categories, leakage and pipelines), then trees and gradient boosting, explaining models, unsupervised learning, recommendations, time series and, finally, production: calibration, monitoring and drift. The course outline lists every lesson in that order.

Checkpoint: implement linear regression with gradient descent from scratch in NumPy, and match the coefficients scikit-learn's LinearRegression finds on the same data.

What can I leave until later?

Deep learning, large language models, reinforcement learning, and deployment tools such as Docker can all wait until you can train, evaluate and explain a classical model. They build on the same foundations: a neural network is trained by the same gradient descent, and evaluating one uses the same test-set discipline. Starting there first usually means copying code you cannot debug.

For the distinction, read machine learning vs deep learning. When you are ready for a first neural-network project, PyTorch vs TensorFlow helps you choose a workflow.

Also leave out, at first: comparing ten algorithms on one dataset, tuning hyperparameters before you have a baseline, and chasing benchmark scores. One model you understand fully is worth more than ten you called.

Where to apply machine learning

Once you can train and evaluate a model, apply it to a problem from a field you already know. Machine learning fits wherever there are records of past cases and a decision to make about new ones: forecasting demand, flagging unusual transactions, sorting support messages, classifying images or predicting a measurement from sensor data. Domain knowledge helps you choose the target, spot leakage and judge whether an error matters.

For worked examples, see machine learning for business analytics, machine learning for predictive analytics and machine learning for natural language processing.

How long does it take to learn machine learning?

From zero, a solid foundation in machine learning is roughly 200 hours of watching, practising and building projects. At about 7 hours a week, that's around 7 months: faster if you already code, slower if you're new to programming. That's not a weekend, but it's a lot less than people fear, if you learn in the right order and practise every idea instead of just watching it.

Hours are only a rough guide, though. A better measure is the checkpoints: if you can pass step 4's checkpoint without looking up each line, you have the foundation of machine learning. Keep a short log of what you built at each checkpoint and where you got stuck; it shows your progress more honestly than counting hours or videos watched.

The one habit that matters most

After every concept, write three sentences without looking: what the method does, what it optimises, and when it fails. If you can't, you watched it; you didn't learn it yet.

Can I learn machine learning without a degree?

Yes, you can learn it. You can learn every topic in the four steps from free lessons, textbooks and library documentation. Whether a particular employer requires a degree is a separate question that depends on the role; the machine learning engineer roadmap covers how to show what you can do through projects.

Is machine learning hard for beginners?

It is hardest when the steps are taken out of order: a model is difficult to debug if the Python is shaky, and its score is difficult to trust if the statistics are missing. Taken in the order above, each new idea builds on one you already have. The maths a beginner needs is a short list, set out in prerequisites for machine learning.

Choose a practical example

What you want to practise Read next
Reading a model report without coding Machine learning for non-technical people
Fitting and checking your first numerical prediction Machine learning for linear regression
Defining a future-facing prediction experiment Machine learning for predictive analytics
Connecting a prediction to an operational decision Machine learning for business analytics
Exploring groups without target labels Machine learning for unlabeled data
Flagging unusual rows for inspection Machine learning for outlier detection
Explaining splits, metrics and model decisions aloud Machine learning for interview

Your next step

Open the learning path and start at the first stage you cannot yet pass. If that is step 1, begin with the Python track.

This is the path SchoolWhool's Foundations of AI course follows, in 15 stages, with a person answering your doubts within 12 hours. Stage 0, Python from zero, is free: start it now.

If you are helping a child get started, see machine learning for kids for free tools by age.

First Principles, the SchoolWhool newsletter

One machine learning idea, explained properly, every week.

The intuition, the common mistake, and a five-minute way to try it yourself. Written by Gaurav.