Machine Learning
Simple ML from zero: examples, splits, loss, ranking, and the loop you use to judge an agent.
- 0120 min
What Is Machine Learning?
ML fits a function from examples, then checks it on data it has not seen. That habit is how you ship agents.
- 0220 min
Features
A feature is a number the model is allowed to see. Garbage features make garbage agents.
- 0321 min
Data and Splits
Train, validation, and test sets — and the leakage bugs that make agent evals lie.
- 0419 min
Baselines
Always beat a dummy: majority class, last week’s prompt, or a keyword rule. If you cannot, you do not have a win.
- 0520 min
Supervised Learning
Every training row has an input x and a target y. No labels, no supervised learning.
- 0621 min
Loss Functions
A loss is a number that is small when the model is right. Training is making that number go down.
- 0721 min
Gradient Descent
Measure how the loss changes when you nudge a knob, then nudge the knob downhill.
- 0820 min
A Linear Classifier
A score, a sigmoid, a cutoff. This is the shape of every routing head you will train.
- 0919 min
Hyperparameters
Learning rate, epochs, batch size, and seeds are knobs you choose — on validation, not on test.
- 1021 min
Overfitting
The model fits the training sample, including accidents, instead of the pattern that will appear tomorrow.
- 1120 min
Regularization
A prior that says be boring: smaller weights, shorter prompts, fewer tools, stop when validation worsens.
- 1221 min
Metrics That Matter
Accuracy lies when classes are rare. Count TP, FP, FN, TN. Then precision, recall, and F1.
- 1320 min
Rare Classes and Thresholds
When the important class is rare, move the cutoff on validation. Accuracy will not tell you.
- 1420 min
Calibration
A score of 0.9 should be wrong about one time in ten. Uncalibrated agents shout 99% on everything.
- 1521 min
Ranking
Retrieval and rerank are not classification. Sort by a score and measure precision at k.
- 1621 min
Embeddings
Meaning as a list of numbers. Close lists rank together. Retrieval is geometry.
- 1720 min
Nearest Neighbors
k-NN labels a new point by a vote of its nearest labeled points. Retrieval is the same geometry without the vote.
- 1821 min
Unsupervised Learning
No labels: find structure. Tiny 2-d k-means, then name the clusters by hand.
- 1922 min
A Tiny Neural Net
A one-hidden-layer forward pass with lists — linear maps, ReLU, and why depth needs a bend.
- 2019 min
Train vs Inference
Training updates knobs. Inference freezes them and only runs the forward pass. APIs you call are inference.
- 2120 min
Drift
The world moves. A model fit on last quarter’s words fails on this quarter’s words. Watch the slice.
- 2221 min
Rewards and Policies
A policy maps a state to an action. A reward says how well that went. Agents already live in this loop.
- 2320 min
Rules, Prompts, or Train
Start with a rule. Then a prompt. Train a small model when the remainder is large, stable, and labeled.
- 2422 min
Traces as a Dataset
Production logs are the dataset. Freeze ids, write a rubric, label a sample, version the split.