Data Science for Economists
2026-06-10
Appendix: bias–variance math, OLS breakdown, LASSO geometry, post-double-selection LASSO, Double ML, more applications.
What is Machine Learning?
“Machine Learning is the science of getting computers to learn without being explicitly programmed.”
\(\qquad\) – Arthur Samuel, 1959
Samuel built a checkers program in the 1950s that played better the more games it had seen. No new code, just more data.
Mitchell (1997)
A computer program learns from experience \(E\) with respect to a class of tasks \(T\) and a performance measure \(P\), if its performance on \(T\), measured by \(P\), improves with \(E\).
Handwriting recognition
Autonomous driving
Today: mostly (1), a quick tour of (2), and (3) only by name.
Common pattern
Hundreds to millions of predictors, often \(p \gg n\). Classical tools wobble.
Supervised Learning
Regression – continuous outcome
Classification – discrete label
Same workflow
The test split protects against overfitting – a model that memorises the training set but generalises poorly.
Binary
Spam / not spam
Multi-class
Iris species
Multi-label
Movie genres (one film can be both thriller and romance)
A First Classifier: \(k\)-NN
Idea: to classify a new point \(x_0\), look at the \(k\) closest training points and take a majority vote.
Euclidean distance
\[ d(p, q) = \sqrt{(p_1 - q_1)^2 + \cdots + (p_n - q_n)^2} \]
\(k = 1\)