A 34-minute working session on the ideas under every ML system: how a model learns from data instead of hand-written rules, the main families of algorithms, how you train and evaluate one — and the honest question of when ML is the wrong tool.
In ordinary programming you write the rules and the computer follows them. Machine learning flips that around: you feed it examples — inputs and the answers you want — and it figures out the rule that connects them. The output is a model you can run on new, unseen inputs.
Same pieces, reversed arrows: classic code consumes rules; ML produces them from data plus answers.
ML is not a default. It adds data pipelines, training cost, drift, and opacity. Reach for plain rules or a lookup table when:
if.Rule of thumb reach for ML when the rules are too many, too fuzzy, or always changing to write by hand — recognizing spam, ranking results, forecasting demand.
Almost everything in classical ML falls into one of three setups, defined by what kind of feedback the model gets while learning: full answers, no answers, or rewards.
Every training example comes with the correct output (the label). The model learns the mapping features → label, then predicts labels for new inputs.
You hand the model raw data with no answers and ask it to find structure on its own — natural groups, or a simpler representation.
An agent takes actions in an environment and gets rewards or penalties. Over many tries it learns a policy that maximizes long-term reward.
Supervised flow: labeled examples train the model once; afterward it labels brand-new inputs.
Most production ML you will meet is supervised — so the rest of this deck leans there.
The task is what you are predicting; the algorithm is how. Click through the three core tasks, then skim the cheat-sheet of algorithms that earn their keep on everyday tabular data.
Fit a line (or curve) through the data; read off a number for any new input.
Learn a boundary that separates the classes; new points are labeled by which side they land on.
No labels given — the algorithm groups points by similarity and you interpret the groups.
Fits a straight-line relationship. Fast, interpretable baseline for predicting a number.
+ simple, explainable
− misses non-linear patterns
Despite the name, a classifier: outputs a probability for a class. The default first model.
+ calibrated, fast
− linear boundaries only
A flowchart of yes/no splits. Human-readable but prone to memorizing the training set.
+ easy to read
− overfits alone
Many trees on random subsets, votes averaged (bagging). Strong, forgiving default.
+ robust, little tuning
− larger, less readable
Trees built in sequence, each fixing the last one's errors. XGBoost / LightGBM dominate tabular contests.
+ top accuracy on tables
− tuning matters
Predict by looking at the k nearest known examples. No real training — it just remembers.
+ dead simple
− slow at predict time
Unsupervised: partitions points into k clusters around moving centers.
+ fast clustering
− pick k; round blobs only
Finds the widest-margin boundary between classes; kernels handle non-linear splits.
+ strong on small data
− scales poorly to huge sets
These shine on structured / tabular data — rows and columns. When the input is images, audio, or free text, hand-made features break down and you move to Deep Learning & Neural Networks, where the model learns its own features.
Two ideas do most of the work: turning raw data into good features, and splitting your data so you measure the model on examples it never trained on. Skip the split and you will fool yourself every time.
The cardinal sin is data leakage: letting any test information sneak into training. The test score then lies, and production disappoints.
A typical 60 / 20 / 20 split. Exact ratios vary; the principle — never test on what you trained on — does not.
Cross-validation rotates the validation fold so every row is tested once — a steadier score than a single split.
Every model lives between two failure modes. Learn too little and it misses the pattern; learn too much and it memorizes noise. Managing that tension — the bias-variance trade-off — is the heart of practical ML.
Same points, three models. The straight line misses the trend; the wiggly line chases every dot; the smooth curve generalizes.
Bias is error from being too simple; variance is error from being too sensitive. Total error bottoms out in between.
Pick the metric that matches the cost of being wrong. On a dataset that is 99% "not fraud", a model that always says "not fraud" scores 99% accuracy and catches zero fraud. The confusion matrix is where you start.
Four outcomes. Which one hurts more — a false alarm or a miss — decides whether you optimize precision or recall.
(TP + TN) / everything. Fine when classes are balanced — misleading when one class is rare (fraud, disease).
TP / (TP + FP). Optimize when a false alarm is costly — e.g. blocking a legit payment.
TP / (TP + FN). Optimize when a miss is costly — e.g. failing to detect cancer or fraud.
The harmonic mean of precision and recall — one number when you need both to be decent and the classes are imbalanced.
The discipline is the same: choose the metric before you train, tied to what a mistake actually costs the business.
A small, stable set of libraries covers almost everything. Then the harder call: ML is powerful, but it is also a liability. Here is the honest balance sheet.
The standard toolkit: regression, classification, clustering, splits, metrics — one clean API.
+ batteries-included, easy to learn
− not for deep learning / GPUs / huge data
Choose when you have rows-and-columns data and want a strong model fast. Start here.
Specialized boosted-tree libraries that win most tabular benchmarks and Kaggle competitions.
+ top accuracy, handles mixed features
− more hyperparameters to tune
Choose when scikit-learn baselines plateau and you need the last few points of accuracy on tables.
The dominant framework for neural networks — flexible, Pythonic, behind most modern research and LLMs.
+ flexible, huge ecosystem
− overkill for small tabular problems
Choose when your data is images, audio, or text — see Deep Learning.
The other major deep-learning stack; Keras gives a friendly high-level API, with strong mobile / serving tooling.
+ mature deployment path
− steeper, heavier than scikit-learn
Choose when you need deep nets plus a battle-tested serving and edge story.
Five quick questions on what ML is, the learning setups, training, the bias-variance trade-off, and metrics — instant feedback, no sign-in.
Navigate with ← → or scroll · back to library