Machine learning

Week 11: double machine learning, kernels, and networks

A flexible model predicts an outcome well. Can it also tell you how much a treatment changes that outcome?

Where we left off

A winning score shows that one model beats another, on one target and one distribution

Deciding whether to offer extra care needs something a score does not give: how much the care changes the outcome, an effect

Today:

  • An effect estimated with flexible fits: double machine learning
  • Features fixed in advance (kernels) and fitted to the outcome (networks)
  • How to tell which parts of a method are needed

Double machine learning, kernels, and networks

Part 1: an effect from flexible fits

Part 2: kernels, features fixed in advance

Part 3: networks, features fitted to the outcome

Part 1: an effect from flexible fits

The target is an effect

Treatment \(T\), outcome \(Y\), and, in the model of the DAG beside this, inputs \(Z\) that hold every common cause of \(T\) and \(Y\) and no consequence of \(T\)

Adjustment theorem: \(\mathbb E[Y \mid do(T = t)] = \mathbb E_Z\big[\mathbb E[Y \mid T = t, Z]\big]\), if \(P(T = t \mid Z) > 0\) (for a continuous \(T\), a positive density)

If the effect of \(T\) is the same for every unit and linear in \(t\), the whole curve is one number \(\theta\): \[\mathbb E[Y \mid do(T = t)] = \theta\, t + \text{constant}\]

Strategy: two staged regression

  • Parametric

\[ Y = T\theta + Z\beta + \varepsilon_Y, \qquad T = Z\alpha + \varepsilon_T \]

Estimate \(\hat\theta\) from e.g. 2SLS

  • Non/semi-parametric PLM (“double machine learning”)

\[ Y = T\theta + g(Z) + \varepsilon_Y, \qquad T = m(Z) + \varepsilon_T \]

Replace LS (least squares) with machine learning methods to estimate “nuisance functions” \(\hat g\) and \(\hat m\)

The partially linear model

\[ \begin{aligned} Y &= \theta\, T + g(Z) + \varepsilon_Y, &\qquad \mathbb E[\varepsilon_Y \mid T, Z] &= 0\\ T &= m(Z) + \varepsilon_T, & \mathbb E[\varepsilon_T \mid Z] &= 0 \end{aligned} \]

  • \(m(Z) = \mathbb E[T \mid Z]\) moves the treatment; \(g(Z)\) moves the outcome directly
  • Regressing \(Y\) on \(Z\) alone estimates neither \(g\) nor \(\theta\), but \[\ell(Z) = \mathbb E[Y \mid Z] = \theta\, m(Z) + g(Z)\]
  • \(m\), \(g\), \(\ell\) are nuisance functions: needed to get \(\theta\), not wanted for themselves. Learners can fit \(m\) and \(\ell\)

Under the adjustment condition, \(\theta\) is the effect of \(T\) on \(Y\)

A first try

Suppose a learner, fitted on other rows, gave us \(\hat g\). Subtract it and regress on \(T\): \[ \hat\theta_0 = \frac{\sum_i T_i\big(Y_i - \hat g(Z_i)\big)}{\sum_i T_i^2}, \qquad \hat\theta_0 - \theta = \frac{\sum_i T_i\,\big(g - \hat g\big)(Z_i)}{\sum_i T_i^2} + \frac{\sum_i T_i\,\varepsilon_{Y,i}}{\sum_i T_i^2} \]

  • The second term averages to zero
  • The first is close to \(\mathbb E\big[m(Z)\,(g - \hat g)(Z)\big] / \mathbb E[T^2]\): first order in the error of \(\hat g\)
  • A learner’s error shrinks more slowly than \(n^{-1/2}\), so this term can dominate the standard error

And \(Y\) on \(Z\) estimates \(\ell\), not \(g\): for a continuous \(T\), fitting \(g = \ell - \theta m\) needs \(\theta\) itself

Residual on residual

Partial \(Z\) out of both, with any learner, then one regression through the origin: \[ \hat\theta = \frac{\sum_i \big(T_i - \hat m(Z_i)\big)\big(Y_i - \hat\ell(Z_i)\big)}{\sum_i \big(T_i - \hat m(Z_i)\big)^2} \]

  • With \(\hat m\), \(\hat\ell\) from least squares on the columns of \(Z\) (and an intercept): exactly the coefficient on \(T\) in the regression of \(Y\) on \(T\) and \(Z\)
  • With learners in place of the projections: the same mechanism, and so far no guarantee

Partialling-out theorem: the coefficient on \(x_2\) is the slope of \(y\) on what is left of \(x_2\) after \(\mathbf X_1\) has explained what it can

The learners’ errors (1 of 2)

\(\hat\ell\), \(\hat m\) fitted on other rows, so on these rows they are fixed functions of \(Z\), with errors \(a = \hat\ell - \ell\) and \(b = \hat m - m\)

\[ \begin{alignedat}{2} &T - \hat m(Z) = \varepsilon_T - b &\qquad& \color{gray}\small T = m(Z) + \varepsilon_T \\[2pt] &\class{fragment}{Y - \hat\ell(Z) = \theta\,\varepsilon_T + \varepsilon_Y - a} && \class{fragment}{\color{gray}\small Y - \ell(Z) = \theta\,(T - m(Z)) + \varepsilon_Y} \\[2pt] &\class{fragment}{Y - \hat\ell(Z) - \theta\,\big(T - \hat m(Z)\big) = \varepsilon_Y - a + \theta\, b} && \class{fragment}{\color{gray}\small \text{subtract } \theta \text{ times the first line}} \end{alignedat} \]

\(\hat\theta\) makes \(\sum_i \big(T_i - \hat m(Z_i)\big)\big(Y_i - \hat\ell(Z_i) - \hat\theta\,(T_i - \hat m(Z_i))\big) = 0\). At the true \(\theta\), each row contributes the score \[ \psi = \big(T - \hat m(Z)\big)\big(Y - \hat\ell(Z) - \theta\,(T - \hat m(Z))\big) = (\varepsilon_T - b)(\varepsilon_Y - a + \theta\, b) \]

The learners’ errors (2 of 2)

\[ \begin{aligned} \mathbb E_{T, Y, Z}[\psi] &= \underbrace{\mathbb E[\varepsilon_T\varepsilon_Y] - \mathbb E[\varepsilon_T\, a] + \theta\,\mathbb E[\varepsilon_T\, b] - \mathbb E[b\,\varepsilon_Y]}_{0:\ \mathbb E[\varepsilon_Y \mid T, Z] = 0,\ \ \mathbb E[\varepsilon_T \mid Z] = 0} + \,\mathbb E[ab] - \theta\,\mathbb E[b^2] \end{aligned} \]

So, for \(\mathbb E[b^2] \ll \mathbb E[\varepsilon_T^2]\), \(\hat\theta - \theta \approx \big(\mathbb E[ab] - \theta\,\mathbb E[b^2]\big)/\mathbb E[\varepsilon_T^2]\), plus noise of order \(n^{-1/2}\): the learners’ errors enter as products (the first try had one error, to the first power). Enough, with regularity conditions (Chernozhukov et al. 2018): \[ \|b\|_2\,\big(\|a\|_2 + \|b\|_2\big) = o_p\big(n^{-1/2}\big), \quad \text{for example both errors } o_p\big(n^{-1/4}\big) \]

The cost of a non-free lunch, square-rooted: Lipschitz in \(p\) inputs gives an error of order \(n^{-1/(p+2)}\), smaller than \(n^{-1/4}\) only for \(p = 1\); a sum of one-input curves, \(n^{-1/3}\). Worst cases over a class; the condition is about our learners’ actual errors

Cross-fitting

Sample splitting, using separate subsets of data to compute

  1. estimates of nuisance functions, like \(\hat\ell\) or \(\hat m\)
  2. the desired causal estimates, like \(\hat\theta\)

Two ways to think of why this is a good idea

  • Independence between \(\hat\ell\) and \(\varepsilon_T\) makes terms like \({\varepsilon_T}_i\,|\hat\ell(Z_i) - \ell(Z_i)|\) small (on average)
  • If \(\hat\ell\) is (a little) overfit, for example, this has less effect on \(\hat\theta\) because \(\hat\ell\) is overfit to a different subset of the data (than the one used to estimate \(\hat\theta\))

Can be iterated: swap subsets and average \(\hat\theta\) estimates

An experiment on the estimator

Beyond least squares the estimator has two parts: residualizing \(T\) as well as \(Y\), and cross-fitting the learners. Design an experiment that shows whether each part is needed.

An ablation: remove one part, keep everything else fixed, run again on the same data, compare. On simulated data the true \(\theta\) is known, so every version can be checked against it

  • A partially linear model with \(\theta = 1\), \(n = 500\), five inputs in \(Z\) (three of them used); \(m\) and \(g\) curved
  • Learner for \(m\) and \(\ell\): bagged trees; nodes of 20 rows or fewer not split
  • 100 simulated data sets; every version run on the same ones

One simulation, each part removed

Removing a part that matters shows as bias against the known \(\theta\). Removing cross-fitting changed little for these trees on these data

The interval

Standard error from the residual regression, allowing unequal variances (lm()’s default does not), with \(\tilde t_i = T_i - \hat m(Z_i)\) and \(\hat e_i = Y_i - \hat\ell(Z_i) - \hat\theta\,\tilde t_i\): \[ \widehat{\mathrm{se}}(\hat\theta) = \frac{\sqrt{\sum_i \tilde t_i^{\,2}\,\hat e_i^{\,2}}}{\sum_i \tilde t_i^{\,2}} \] One \(\theta\) says how much the care helps on average, not who it helps most: ranking patients needs an effect that varies with \(Z\)

In the simulation, \(\hat\theta\) averaged 1.010 with standard deviation 0.059; the standard error averaged 0.058; \(\hat\theta \pm 1.96\,\widehat{\mathrm{se}}\) covered \(\theta\) in 94 of 100 data sets

Nothing here makes \(\theta\) causal. That is the adjustment condition, and no learner checks it

Unobserved confounding

Observed predictors must capture everything about how treatment assignment and treatment effectiveness are related

Practically all methods assume this isn’t happening (some conduct sensitivity analysis)

Honest trees/forests

Split training data, use one subset for deciding tree structure (which variables to use for splitting) and the other subset for predictions

e.g. Suppose we fit a tree with depth 1, on one subset of data we find the best split is \(X_7 < c\). Then for predictions we use the values of \(Y\) in a separate subset of data, averaging/voting those \(Y\) values with \(X_7 < c\) for one prediction and those with \(X_7 \geq c\) for the other prediction. (No test/validation yet)

Exercise: explain how this is different from the out-of-bag validation approach in bagging. Draw diagrams (perhaps with inspiration from ISLR Figure 5.5) to represent the two cases

Limits

Weak overlap. If \(Z\) nearly determines \(T\), then \(T - \hat m(Z)\) is nearly zero for most rows, and \(\hat\theta\) divides by almost nothing

An effect that varies with \(Z\). If \(Y = \theta(Z)\,T + g(Z) + \varepsilon_Y\), residual on residual estimates \[ \frac{\mathbb E\big[\theta(Z)\,\mathrm{Var}(T \mid Z)\big]}{\mathbb E\big[\mathrm{Var}(T \mid Z)\big]}, \] a weighted average of the effects, weighted toward the units whose treatment varies most, which generally differs from the average effect \(\mathbb E[\theta(Z)]\)

Part 2: kernels, features fixed in advance

e.g. Polynomial embedding

Consider this polynomial transformation:

\[ \varphi(x_1, x_2) = (x_1, x_2, x_1^2, x_2^2, x_1x_2) \]

This function \(f\) is linear in the higher-dimensional features

\[ f(\mathbf x) = \color{#21918c}{\beta_0} + \color{#21918c}{\beta_1} x_1 + \color{#21918c}{\beta_2} x_2 + \color{#8c2981}{\beta_3} x_1^2 + \color{#8c2981}{\beta_4} x_2^2 + \color{#8c2981}{\beta_5} x_1x_2 = \beta_0 + \beta^T \varphi(\mathbf x) \]

A spline is regression on basis functions chosen in advance: the same idea, with a different basis

Millions of features

With \(p = 100\) inputs, the polynomial features of degree up to 4 number \(\binom{104}{4} = 4{,}598{,}126\). With \(n = 1{,}000\) rows, ridge on these features solves a system with millions of unknowns. Is there another way to compute the same predictions?

Ridge, computed two ways

\(\mathbf y\) and the columns of \(\mathbf X\) (\(n \times p\)) centered, so no intercept. For \(\lambda > 0\): \[ \mathbf X^T(\mathbf X\mathbf X^T + \lambda \mathbf I_n) = \mathbf X^T\mathbf X\mathbf X^T + \lambda\mathbf X^T = (\mathbf X^T\mathbf X + \lambda\mathbf I_p)\,\mathbf X^T \] Both brackets are invertible (\(\mathbf X^T\mathbf X + \lambda\mathbf I\), as for ridge; \(\mathbf X\mathbf X^T + \lambda\mathbf I\), the same way), so \[ \hat\beta_\lambda = (\mathbf X^T\mathbf X + \lambda\mathbf I_p)^{-1}\mathbf X^T\mathbf y = \mathbf X^T(\mathbf X\mathbf X^T + \lambda\mathbf I_n)^{-1}\mathbf y \]

  • A \(p \times p\) system, or an \(n \times n\) one
  • A prediction, \(\bar y + x^T\hat\beta_\lambda = \bar y + (\mathbf X x)^T(\mathbf X\mathbf X^T + \lambda\mathbf I_n)^{-1}\mathbf y\) (\(x\) centered at the training means), uses the inputs only through inner products: \(x_i^Tx_j\) in \(\mathbf X\mathbf X^T\), and \(x_i^Tx\) in \(\mathbf Xx\)

“Kernel trick”

Avoid computing \(\varphi(\mathbf x)\), which may be high (infinite) dimensional

e.g. For degree \(d\) polynomial, dimension \(p \mapsto \binom{p+d}{d}\), but

\[ \langle \varphi(\mathbf x_i), \varphi(\mathbf x_j) \rangle = K(\mathbf x_i, \mathbf x_j) = (1 + \mathbf x_i^T \mathbf x_j)^d \]

For \(p = d = 2\): \(\varphi(\mathbf x) = (1, \sqrt2\, x_1, \sqrt2\, x_2, x_1^2, \sqrt2\, x_1x_2, x_2^2)\), the polynomial embedding with a constant and weights

much higher dimensional inner product

\(p\)-dimensional inner product followed by power of scalar

Pros: fast computation despite high-dimensional embedding

Cons: memory-based, like \(k\)-NN, “memorize the training data”

Kernel ridge

\(\mathbf y\) centered. Replace every inner product by a kernel \(K(x, x') = \langle\varphi(x), \varphi(x')\rangle\): the \(n \times n\) matrix \(\mathbf K\) with entries \(K(x_i, x_j)\), and \(\mathbf k(x) = \big(K(x, x_1), \ldots, K(x, x_n)\big)\) \[ \hat f(x) = \bar y + \mathbf k(x)^T(\mathbf K + \lambda\mathbf I)^{-1}\mathbf y = \bar y + \sum_{i=1}^n \hat\alpha_i\, K(x, x_i), \qquad \hat\alpha = (\mathbf K + \lambda\mathbf I)^{-1}\mathbf y \]

  • Ridge regression on the features \(\varphi\) (not centered), never written down
  • To predict at \(x\): the similarities of \(x\) to each training point, then a weighted sum

Representer theorem: minimizing squared error plus \(\lambda\) times the squared norm over the whole space of functions that \(K\) defines gives a fit of this form, a combination of \(K(\cdot, x_i)\) over the \(n\) training points

Kernels: similarity

For any inner product \(\langle \cdot, \cdot \rangle\)

  • \(K(\mathbf x, \mathbf x') = \langle \mathbf x, \mathbf x' \rangle\) is a kernel, and so are
  • \((1 + \langle \mathbf x, \mathbf x' \rangle)^d\): degree \(d\) polynomial
  • \(\exp(-\| \mathbf x - \mathbf x' \|^2 / 2h^2)\): radial basis, Gaussian, bandwidth \(h\)
  • \(\tanh(\kappa_1 \langle \mathbf x, \mathbf x' \rangle + \kappa_2)\): neural network (not positive semi-definite in general)

Bandwidth and \(k\)

All three are weighted sums of the outcomes, with weights that sum to one; kernel ridge’s can be negative. For the kernel-weighted average the bandwidth plays the part of \(k\): \(h \asymp (k/n)^{1/p}\), and the \(k\)-NN rate’s \((k/n)^{2/p} + 1/k\) becomes \(h^2 + 1/(nh^p)\)

\(k\)-NN rate: \(C_pL^2(k/n)^{2/p} + \sigma^2/k\), balanced at \(k \asymp n^{2/(p+2)}\)

Cost and the curse

  • Fitting: an \(n \times n\) system, about \(n^3\) operations. With \(n = 10^5\) rows, about \(10^{15}\)
  • Predicting: every training row kept and used, as in \(k\)-NN
  • Many inputs: nothing is near. From a new point to 1,000 standard normal points, the nearest distance over the farthest (median over new points) is 0.0003 with \(p = 1\), 0.24 with \(p = 10\), and 0.67 with \(p = 100\). At \(p = 100\) the nearest point is 0.67 times as far away as the farthest, so even the weight a narrow kernel puts on the nearest point is not local

Curse of dimensionality: in many dimensions, the nearest 1% of the data is far away

Lasting impacts of kernels

  • “Automatic” feature engineering

  • Outside low-dimensional motivating examples, typically don’t choose type of kernel very carefully

  • Ultra-algorithmic supervised ML philosophy: focus on expanding expressivity of the function class, let efficient optimization algorithms do the work of “respecting the structure in the data”

  • Influential idea \(\to\) deep learning

Part 3: networks, features fitted to the outcome

Function approximation of \(\mathbb E[\mathbf y | \mathbf x]\)

  • Linear models

  • Linear models with global transformations of predictors

    • \(\mathbf x_j' = \varphi_j(\mathbf x_j)\)
  • Additive non-linear models

    • Kernel methods \(\hat f(\mathbf x) = \mathbf k(\mathbf x)^T \hat\alpha\)
    • GAMs, similar to global with supervised learning of \(\hat \varphi_j\)
    • Trees and ensembles of trees (sums of indicators)
  • Compositional non-linear models

\[\hat f(\mathbf x) = \hat f_L \circ \cdots \circ \hat f_2 \circ \hat f_1(\mathbf x) = \hat f_L ( \cdots ( \hat f_2 (\hat f_1(\mathbf x)) \cdots )\]

Freeze the first layer

Draw the hidden units’ weights (dashed) at random and never train them; fit only the output weights. What kind of model is left?

Least squares on \(M\) fixed features \(h_1(x), \ldots, h_M(x)\); with a penalty on the output weights, ridge. By part 2, kernel ridge with \(K(x, x') = 1 + \sum_{k=1}^M h_k(x)\,h_k(x')\), the 1 for the output’s bias: random features, the name from Rahimi and Recht (2007). Training the first layer fits the features to \(y\)

A GLM of GLMs: \(h_k(x) = g^{-1}(w_{k0} + w_k^T x)\), \(f(x) = \beta_0 + \sum_k \beta_k h_k(x)\)

Frozen or trained: one direction

\(p = 10\) standard normal inputs, noise sd 0.5, \(f^\star(x) = \sin(2u) + u^2/2\) with \(u = v^Tx\), one direction \(v\). Excess risk \(\mathbb E\big[(\hat f(X) - f^\star(X))^2\big]\)

Same network, same start, \(M = 10\): training the first layer takes the excess risk at \(n = 2{,}000\) from 0.99 to 0.054; frozen at 20 times the width, 0.55

The trained first layer

3 of 10 trained units point along \(v\) (\(|\cos| > 0.99\); at the start, at most 0.71; \(n = 1{,}000\)). Radial truth: kernel ridge does best; every network does about as well as linear regression

No free lunch theorem: choosing a method is an assumption about the world

Specialized optimization

After network architecture is fixed, how do we train the network / estimate the weights and biases?

To use gradient descent, need to compute gradient of \[ \sigma_L (\cdots \sigma_2(\beta^{(2)}_0 + \sigma_1(\beta^{(1)}_0 + \mathbf X \beta^{(1)}) \beta^{(2)}) \cdots ) \] with respect to all the \(\beta\)’s (\(\sigma_l\): activation functions, the logistic \(g^{-1}\) in our networks)

Chain rule, automatic differentiation, efficient implementations, handling numerical issues, etc

Backpropagation: the chain rule, run from the output backward

Epoch: one gradient descent pass over entire training data

Algorithm and software side of the DL revolution

Deep = multiple hidden layers

Each layer’s units are features of the layer below: \(f = f_L \circ \cdots \circ f_1\), with \(M_1(p + 1) + M_2(M_1 + 1) + M_2 + 1\) weights for two layers, all fitted to \(y\)

Specialized modeling choices

For deep networks, choose number \(L\) of (hidden) layers, and for every layer choose

  • Layer type (dense, convolutional, pooling, …) (matrix/tensor multiplication with some kind of structure)
  • Number/shape (e.g. vector/matrix/tensor) of outputs
  • Activation function (ReLU, sigmoid, linear, tanh, …)
  • Regularizer (L1 or L2 norm penalties, dropout, …)

Compare to e.g. regularized kernel regression: choose kernel, regularizer, bandwidth. Not that many choices.

Network architecture = combinatorial explosion of choices

Modeling side of the DL revolution

The same data, twenty starting points

  • Only the starting weights differ. Trained, \(M = 10\): median 0.058, from 0.050 to 0.129; \(M = 20\): median 0.105, from 0.096 to 0.113
  • 1 of 20 starts at \(M = 10\) scored worse than every run at \(M = 20\): with one run each, \(M = 20\) would have looked better in 5% of pairings. Frozen against trained is not close

An ablation is an experiment

Remove or replace one part, hold everything else fixed, score again on the same rows

  • Compare paired, with a standard error, over several random starts
  • Choose the ablations before the test rows are opened
  • Say whether the reduced version was tuned again
  • The answer is about this pipeline on this distribution: removing cross-fitting changed little above, for those trees on those data
  • Parts can interact: whether cross-fitting is needed depends on the learner, so removing one part at a time can mislead

Comparing two models on the same rows: pair the losses, \(\Delta_j = \ell_{A,j} - \ell_{B,j}\); the standard error \(\mathrm{sd}(\Delta)/\sqrt m\) is small when the models err on the same rows

Ablations already run

  • Permutation importance: one input scrambled, no refit. Does the fitted model use it?
  • Leave one covariate out: one input removed, the model refitted. Does the pipeline need it? An input that another stands in for can score near zero on both and still matter in the world
  • Every leaderboard’s baseline: everything removed
  • Bagging beside a random forest: one change, the inputs sampled at each split
  • Today: double ML with each part removed; a network with its first layer frozen

Benefits of deepness

Some functions require exponentially many parameters to represent with a 2-layer network, but grow polynomially if depth of network increases

Expressivity depends more strongly on depth

Specialized regularization

  • Dropout is like bagging

  • During training: randomly drop units, iteration of gradient descent uses subnetwork

  • During testing: use full network

Averaging over many models represented by all possible subnetworks

Questions/mathematical lessons

Non-convex, but doesn’t seem to suffer local minima problems

Overparametrized so global optimum is 0 training loss. Real question is why do these solutions generalize, aren’t overfit?

  • “Implicit regularization” - SGD converges to minimum norm solutions
  • Warning: optimization and generalization are not equivalent! No guarantee that minimum norm solution is a good one, but maybe if there’s signal in the data
  • e.g. can always find a minimum norm solution to predict \(y\) sampled independently from rnorm(n) (no true signal)

Double descent: past the interpolation threshold, the minimum-norm interpolant’s test error can fall again

History / connection to “neurons”

Early work (1943) motivated by analogy to neurons, “activation” of a neuron cell’s action potential which sends an electric signal to connected neurons

Equivalence between a mathematical model of brain activity and boolean logic

Useful analogy, can inspire research ideas (remember it’s just an analogy, it doesn’t mean actual brain biology works this way or that neural networks are like thinking brains…)

Universal approximation (Cybenko 1989). For any continuous \(f\) on \([0, 1]^p\), any continuous sigmoidal \(\sigma\) (such as \(g^{-1}\)) and any \(\epsilon > 0\), there are \(M\) and weights with \(\big|f(x) - \sum_{k=1}^M \beta_k\, \sigma(w_{k0} + w_k^Tx)\big| < \epsilon\) for every \(x\) in \([0, 1]^p\). Existence only: nothing about \(n\) or the fit

Without the tool

Think of the method you would reach for first in your project. How would you do the job without it?

Terence Tao, to mathematicians: once a favorite tool has proved something, rewrite the argument without it; if you understand the tool you can, at the cost of a longer, messier argument. My generalization: ask how you could do the job without the tools you usually rely on

Tool Without it What that showed
learners in double ML linear partialling out biased: the confounding is curved
the polynomial kernel explicit features, then ridge the same predictions
a trained first layer frozen random features far worse on one truth only
cross-fitting in-sample residuals little change, for these trees

Recap of the course

  1. The loss and the target define the problem: the optimal model theorem, the optimal threshold, quantiles
  2. Training error underestimates the risk: the optimism theorem; hold rows out, and open the test set once
  3. Faster rates need assumptions: no free lunch, and the cost of a non-free lunch
  4. Shrinkage trades bias for variance: the bias–variance decompositions, ridge and the lasso, averaging
  5. Prediction is not intervention: the adjustment theorem; double ML needs it too
  6. A score is evidence about one target on one distribution: not a license to deploy

Before the seminar

  • This week: exercises 1 and 2 at the top of the notebook. Ridge computed two ways, proved with every step; and the expected score of residual on residual, with the slides closed

  • In the seminar: kernel ridge in a few lines of R against ridge on the explicit features; then double ML’s ablation by simulation, with a learner for which cross-fitting does matter

Conclusion

An effect from flexible fits

Residual on residual, with learners fitted on other rows: their errors enter as products. Causal only under the adjustment condition

Features

Kernels fix them in advance and compute without writing them down; networks fit them to \(y\), which helps when \(f^\star\) has structure such as one direction

Which parts are needed

Remove it, hold the rest fixed, and compare against the noise

Course survey

Please fill in the course survey now: five minutes

References

  • Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W. and Robins, J. (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal 21(1), C1–C68. doi:10.1111/ectj.12097
  • Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems 2(4), 303–314. doi:10.1007/BF02551274
  • Rahimi, A. and Recht, B. (2007). Random features for large-scale kernel machines. Advances in Neural Information Processing Systems 20, 1177–1184. papers.nips.cc/paper/3182
  • Tao, T. (2007). Learn the limitations of your tools. What’s new (blog), career advice. terrytao.wordpress.com/career-advice/learn-the-limitations-of-your-tools