What Is Machine Learning, Really?
Programs That Learn from Data
Classic software is rules you write by hand: if total > 10000: flag_order(). Machine learning flips that — you show the computer thousands of examples of flagged and clean orders, and it derives the rules itself. The output of training is a model: a function with learned parameters that maps inputs to predictions.
ML wins when the rules are too subtle, too numerous, or too fast-changing to hand-write: spam detection, price prediction, image recognition, recommendations.
The Three Families
- Supervised learning — you have labelled examples (inputs and the right answer). Predicting house prices (regression) or spam/not-spam (classification).
- Unsupervised learning — no labels; find structure. Customer segmentation (clustering), compression (dimensionality reduction).
- Reinforcement learning — an agent learns by acting and receiving rewards. Game-playing, robotics, ad bidding.
This series focuses on supervised and unsupervised learning — they cover the vast majority of ML shipped in industry.
The Workflow You’ll Repeat Forever
- Frame the problem — what do you predict, and what decision does the prediction drive?
- Get and clean data — usually 70% of the work.
- Split the data — train on one part, evaluate on data the model has never seen.
- Train a baseline — the simplest model that could possibly work.
- Evaluate honestly — with metrics that match the business problem.
- Iterate — better features usually beat fancier models.
- Ship and monitor — models decay as the world changes.
Environment Setup
python3 -m venv .venv
source .venv/bin/activate
pip install numpy pandas scikit-learn matplotlib jupyterVerify everything imports:
python3 -c "import numpy, pandas, sklearn; print(sklearn.__version__)"We’ll use scikit-learn for classical ML and add PyTorch when we reach neural networks. Jupyter notebooks are ideal for exploration; production code goes in .py files.
One Mental Model to Keep
Every supervised algorithm in this series — linear regression to deep networks — does the same thing: pick parameters that minimise a loss function measured on training data, and hope the result generalises to new data. Hold onto that sentence; it makes everything else click.