What machine learning is
Don't write the rules. Write down what a good rule looks like, and let the
computer find the one that fits your data.
The whole course, in one idea.
Programming vs. learning
- Programming: you know the rule, you write it down.
- Machine learning: you don't know the rule, but you have examples of it — and you'd like the computer to recover it.
- Worth it when the rule is real but too big or too fuzzy to hand-code (spam, tumors), and it drifts.
- Not worth it when the rule is short and stable. Then just write the rule.
History
- 1959 — Arthur Samuel's self-improving checkers program coins "machine learning."
- 1958 — Rosenblatt's perceptron learns a boundary from examples, weights nudged by mistakes.
- 1970s–80s — expert systems try to hand-code knowledge as thousands of if-then rules. They rot.
- The comeback: stop writing rules, show the machine examples, let it infer. That bet is the whole subject.
Two flavors, same points
Left: you gave the labels, the model learns a boundary. Right: no labels, the
model discovers the groups.
The whole field, one line
θ∗=argθminN1i=1∑Nℓ(fθ(xi),yi)
- fθ — the model. Change it → threshold, tree, network.
- ℓ — the loss. Change it → what "wrong" means.
- argmin — the training algorithm. Change it → brute force, gradients.
Pick those three and you've specified a learning method completely.
Learning = reducing loss
Slide the threshold, watch the misclassification rate fall to its minimum. That
descent is the entire algorithm.
Fit, predict, evaluate
- Both learners score 1.000 test accuracy (fraction of held-out points correct, unitless 0–1) — the toy set is separable by design.
- Unsupervised clustering scores adjusted Rand index 1.000 vs the sealed blob ids — structure recovered with no labels.
- scikit-learn does both in one line each, through the
.fit / .predict interface every later chapter reuses.
Takeaways
- Every chapter is the same loop: pick a model family, define a loss, minimize it on data, check it generalizes.
- ML is worth it when the rule is too many or too fuzzy to hand-code — and it drifts. Otherwise write the rule.
- Data quality beats algorithm cleverness. Almost always.
- Learn the
.fit / .predict interface once; the whole library is free after that.