TL;DR
- Machine learning automates inductive inference: from finitely many examples to a general rule. This only works with an inductive bias (an idea of what we look for) and only if the data contains a signal about the output.
- Setup: on . A loss says how expensive an error is. The true risk is . The Bayes risk is the best possible risk, and a function attaining it is a Bayes classifier .
- For the 0-1 loss, the Bayes classifier is explicit: iff (Theorem 2). Its error at is .
- Surrogate losses (hinge, squared, exponential, logistic) act on a real scoring function . They have different Bayes predictors , but after thresholding at 0 all of them give the 0-1 Bayes classifier: they are classification-calibrated.
- For regression with the squared loss, the Bayes predictor is the regression function (Theorem 4), because .
- Decision theory: priors only, maximum likelihood, maximum a posteriori, and the Bayes decision rule with costs: predict the label with the smallest conditional risk. For two classes: predict 1 iff . Decision boundaries are the points where the two weighted curves cross.
Exam relevance
- Real exam, task type “Bayes decision” (4 P): a diagram of class-conditional densities is given. You determine the decision boundaries mathematically for ML, MAP or a cost-sensitive rule, compute the error, and reason backwards: which prior or which cost ratio produces a given boundary. See Reading decision boundaries off a diagram.
- Mock exam, task 3: cost-sensitive Bayes classification on a discrete : , , the Bayes classifier and its error, the threshold , the smallest prior that flips a decision. See the task on the Bayes classifier.
- Multiple choice: consistency of definitions (Bayes risk vs. Bayes classifier, ML vs. MAP), which loss gives which Bayes predictor.
- Sheet 1, Exercise 2 is the same task type as the exam (three classes, prior and loss from a given rule). Exercise 3 is the proof.
Overview: 1. A very short history of AI and ML, 2. Machine learning as inductive inference, 3. The statistical setup: loss, risk, Bayes classifier, 4. Optimal predictions in closed form (0-1 loss, surrogate losses, loss), 5. Statistical and Bayesian decision theory, 6. Reading decision boundaries off a diagram (exam training).
Introduction
A very short history of AI and ML
Slides 4-23
The lecture starts with a short history (for a longer version, see the introduction of Hardt and Recht, Patterns, Predictions, and Actions).
| Decade | What happened |
|---|---|
| 1950s | AI gets “invented” at the Dartmouth Summer Conference (1956). Main paradigm: symbolic AI. Rosenblatt’s perceptron (1957) is the first machine that learns: 400 photosensors, a 20 × 20 pixel image, two classes. Huge optimism (“within ten years a digital computer will be the world’s chess champion”, Simon 1958). |
| 1960s | Symbolic AI, ELIZA (1966) mimics a psychotherapist with pattern matching. Minsky and Papert (1969): a single-layer perceptron can only learn linearly separable functions, for example not XOR, and nobody knows how to train multi-layer perceptrons. |
| 1970s | AI winter (Lighthill Report, 1973). First steps in statistical pattern recognition: kNN, naive Bayes, Bayesian decision theory, learning from few hand-designed features. |
| 1980s | Backpropagation makes multi-layer networks trainable (hand-written digits). Decision trees (ID3). |
| 1990s | Deep Blue beats Kasparov (brute-force search, no learning). Modern ML rises: support vector machines, first generalization bounds (VC dimension). |
| 2000s | ML becomes practical: kernel methods, boosting, random forests and bagging, concentration inequalities and generalization bounds. Spam filtering, recommender systems, bioinformatics. DARPA Grand Challenge (2005), Watson wins Jeopardy (2011). |
| 2010s | Deep neural networks: ImageNet with CNNs and GPUs (2012), AlphaGo (2016), transformers (Vaswani et al., 2017). |
| 2020s | Generative AI for images, audio, text and video. Language and foundation models, coding agents. |
Several topics of this course appear here: the perceptron (Lecture 2), the VC dimension (Lecture 3), boosting and bagging (Lecture 6) and deep networks in the overparameterized regime (Lecture 8).
What this lecture is about
Slides 28, 30-32
The lecture is rather theoretical. It tries to make the point why and under which assumptions machine learning works or doesn’t work:
- the statistical setup of machine learning: Bayesian decision theory, convergence, consistency, estimation and approximation error, bias-variance tradeoff
- the fundamental principles that enable machine learning (learning theory, stability, regularization, aggregation), both in the classical and in the overparameterized regime
- learning in the interpolation regime and why and when it works
- practical issues: data, training, validation, benchmarking
- machine learning and society: fairness, discrimination, explainability, legal frameworks
Not covered: basic ML algorithms (see an introductory ML course), unsupervised learning, reinforcement learning, probabilistic learning, online learning, time series, images and language models.
Required: maths for ML (linear algebra, multivariate calculus with gradients and Hessians, probability theory) and some first ML algorithms. Literature: mainly Hardt and Recht (2022) and Shalev-Shwartz and Ben-David (2014), sometimes Bach (2024), Hastie, Tibshirani and Friedman, Mohri, Rostamizadeh and Talwalkar, Hardt’s book on benchmarks, and Devroye, Györfi and Lugosi (1996).
Machine learning as inductive inference
Deduction vs. induction
Slides 35-39
Deductive inference
Reasoning from one or more general statements (premises) to a logically certain conclusion. If the premises are correct, all conclusions are correct as well.
Example: every person in this room is a student, every student is older than 10 years, so every person in this room is older than 10 years. Mathematics is built on deduction. But deduction has no natural way to deal with uncertainty about the premises.
Inductive inference
Reasoning that constructs or evaluates general propositions derived from specific examples. The conclusion can always be wrong.
Example: in all our experiments, dropped things fall downwards, so we conclude that things always fall downwards. Humans draw such uncertain conclusions from limited experience all the time.
Machine learning (one way to define it)
Machine learning tries to automate the process of inductive inference.
Why should machine learning work at all?
Slides 40-44
Regression example: we are given input-output pairs with , and want to learn a function . What is ?



Both guesses on slide 41 fit the data perfectly. Which one is better cannot be decided from the data alone.
Consequence 1: inductive bias
We need to have an idea what we are looking for. This is called the “inductive bias”. Learning is impossible without such a bias.
Examples: is periodic (daily temperatures), is “simple” (caution, see learning theory later), similar inputs lead to similar outputs.
Now the lecturer reveals that the were produced by a uniform random number generator (slide 43). Then no prediction for is better than any other.
Consequence 2: there must be a signal
We can only learn if there is something we can learn: the input has to contain some signal about the output (Y “has something to do” with X, there is a simple rule that produces the output).
Excursion: inductive bias in animal learning
Slides 45-47
Rats get two kinds of water, one makes them sick.
- Experiment 1: the two kinds taste differently. Rats learn very fast to avoid the water that makes them sick.
- Experiment 2: the same taste, but one kind comes with audio-visual stimuli (sounds, light). Rats do not learn to avoid it.
From the point of view of evolution, the taste of food is related to getting sick, sounds are not. The rat has an inductive bias. In psychology this is the Garcia effect (Garcia et al., 1960s).
Bottom line
Machine learning can only work on reasonable data. Any successful learning algorithm has an inherent inductive bias. For some algorithms the bias is obvious, for others it is hard to understand what it is and how to change it. But if the algorithm works, there has to be a bias. The rest of the course makes this precise.
Predicting based on perfect knowledge
The standard statistical setup
Slides 48-54
In this section we assume complete knowledge of the distribution and ask how to derive the best predictions from it (Bach Sec. 2, Devroye et al. Sec. 2, Hastie et al. Sec. 2.4-2.9).
Data spaces and distribution
- input space , output space (each with a -algebra, which we ignore)
- a probability distribution on
- no assumption on the form of , and both inputs and outputs are random quantities
Classifier, prediction function
A function . If is discrete this is classification, if it is regression (other outputs, for example structured prediction, are possible).
Loss function
A function that measures how “expensive” an error is.
- 0-1 loss for classification: if and otherwise
- squared loss for regression:
The choice of the loss influences the inductive bias.
Sometimes the loss has to depend on (a wrong medical decision is worse for some patients than for others), and sometimes on the order of and : predicting “healthy” for a sick person is worse than the other way around. Later we often drop and write .
True risk
Slide 55
True risk (true expected loss)
The expectation is over the random draw of . The goal of machine learning is to use the training data to construct a function whose true risk is as small as possible.
Bayes risk and Bayes classifier
Slide 56
Bayes risk and Bayes classifier
If the infimum is attained, is called the Bayes classifier (or Bayes predictor). It is not necessarily unique.
Trap
is a number (the smallest achievable risk), is a function. only if is a deterministic function of . With overlapping classes, even the Bayes classifier makes errors.
Optimal prediction functions in closed form
Classification under 0-1 loss: the regression function
Slides 57-62
Let on . We describe by two quantities:
Marginal and regression function
- is the marginal distribution of :
- the regression function is . For binary classification,
Intuition
If is close to 0 or 1, classifying is easy: almost all points at have the same label. If is close to , both labels are about equally likely at , and every classifier makes many errors there.
Proposition 1 (unique decomposition)
The distribution is uniquely determined by and .
Intuition (discrete case):
The formal proof for the general case is in the first pages of Devroye, Györfi and Lugosi.
Mini example: from a joint table to and
0.10 0.45 0.30 0.15 , . , . Backwards: gives the table again.
Explicit form of the Bayes classifier for the 0-1 loss
Slides 63-67
Under the 0-1 loss, the risk counts how often a classifier fails:
The Bayes classifier was defined implicitly as the minimizer. Now consider
Theorem 2 ( is a Bayes classifier)
Consider classification with the 0-1 loss. Let be any (measurable) classifier. Then
So : for the 0-1 loss we have an explicit formula for the Bayes classifier. In practice this does not help, because we do not know .
Proof of Theorem 2
Step 1. Fix a classifier and a point . Since is deterministic (step ),
Step 2. Compare the pointwise error of with the one of . Plugging in step 1 and simplifying:
For : if , then and both factors are . If , then and both factors are .
Step 3. The inequality holds for every , so it also holds in expectation over : .
Consequence: the Bayes error
Step 1 with gives the pointwise error . So
In words: at every , the Bayes classifier loses the smaller of the two joint probabilities.
Exam-style task: Bayes classifier on a discrete input (4 P)
Let and with prior and class conditionals
0 1 2 0.1 0.3 0.6 0.5 0.3 0.2 (a) (1 P, easy) Compute and for all and state the 0-1 Bayes classifier.
(b) (1.5 P, harder) Compute the Bayes error. Then use the loss , with : which classifier is optimal now, and what is its risk?
(c) (1.5 P, backwards) For which values of does the optimal classifier predict 1 at (ties toward 1)?
Solution
(a) Joint probabilities : . : . So and . Bayes classifier: , , . (1 P)
(b) Bayes error (0.5 P). With costs, predicting 0 at costs and predicting 1 costs , so predict 1 iff . Decisions: , so flips. Risk: (the old rule would cost ). (1 P)
(c) Predict 1 at iff . Missing a 1 must cost at least times as much as a false 1. (1.5 P)
→ Practice: Mock exam, task 3 (same structure, different numbers). Sheet 1, Exercise 3 for the version.
Other classification losses: scoring functions
Slides 68-73
The 0-1 loss is hard to work with: it is not continuous and not convex, so it cannot be optimized with gradients. So one uses other loss functions. To account for this, the setup changes slightly:
Scoring function
For binary classification with labels , consider a real-valued scoring function and threshold it at 0:
A point is classified correctly iff . The product is the margin.
The Bayes predictor is the scoring function that minimizes the risk, , and the classifier is . With labels the regression function becomes
so and . The 0-1 Bayes classifier is iff iff .
There are many losses in this regime: hinge, squared, exponential, logistic. For binary classification, the cross-entropy loss coincides with the logistic loss.
Bayes predictors for various loss functions
Slides 74-78
Bayes predictors (slide 74)
name loss Bayes predictor classifier hinge if , if iff squared iff exponential iff logistic iff
Two observations (slide 75)
- Different losses give different Bayes predictors: they induce different inductive biases, because they prefer slightly different scoring functions.
- Surprisingly, the thresholded classifiers are all the same and coincide with the Bayes classifier under the 0-1 loss. This property has a name: the loss is classification-calibrated (more later in the course).
Proof for the exponential loss
Risk at a point . The scores are real, the labels are still :
Minimum. Write and set the derivative to zero ( is a constant here):
The second derivative at is , and the function is convex, so this is the global minimum.
Classifier. .
Mini example:
Then and .
- hinge:
- squared:
- exponential:
- logistic:
Four different scores, one label: all are positive, so all predict , like the 0-1 Bayes classifier ().
The exponential loss comes back in Lecture 6: AdaBoost minimizes it.
Regression under the squared loss
Slides 79-84
Regression looks similar, with one important difference: can be any real number, so we cannot split into the two cases . Conditional expectations are integrals, not sums. Consider the squared loss and the regression function .
Proposition 3 (decomposition)
An inequality with would be trivial (triangle inequality). The equality is not.
Proof of Proposition 3
Add and subtract and expand the square:
The mixed term is 0. By the tower property , and because is a function of it can be pulled out of the inner conditional expectation:
since . (Details with conditional expectations: Györfi, Kohler, Krzyżak and Walk, p. 2.)
Theorem 4 (explicit form of the optimal solution)
The function minimizes the risk.
Proof: in Proposition 3, the second term does not depend on . The first term is and equals 0 for .
Mini example: Bayes predictor and Bayes risk for the squared loss
with . Given , is 1 or 3 with probability each. Given , is 2 or 6.
- , : this is .
- Bayes risk .
- The constant has risk .
The same result in Sheet 1, Exercise 3: minimize pointwise, gives , and the Bayes risk is : the noise that no predictor can remove.
Statistical and Bayesian decision theory
More than just Bayes classifiers
Slides 85-88
So far we derived the explicit Bayes classifier for particular losses. Now we look at several ways to come up with “perfect classifiers” in a slightly more abstract setting (Hastie Sec. 2.4-2.9, Devroye Sec. 2).
Running example: predict the gender of a person from the body height. We know the class conditional distributions (two bell curves, the female one peaks around 165 cm, the male one around 178 cm). How would you label ?
Approach 1: just look at the priors
Slides 89-90
Decide based on the class priors only: always predict the label of the larger class.
Visually: select the higher bar. This ignores completely (“a bit stupid”). Its error is .
Approach 2: maximum likelihood principle
Slides 91-92
Decide based on the likelihood functions , the class conditional distributions and . Predict the label with the higher likelihood:
Visually: select according to which class-conditional curve is higher. ML ignores the priors.
Approach 3: Bayesian a posteriori criterion
Slides 93-94
Decide based on the posterior distributions (Bayesian maximum a posteriori, MAP). Compute
and predict iff . Visually: select according to which posterior curve is higher. The denominator is the same for both classes, so MAP compares .
MAP = Bayes classifier for the 0-1 loss
The MAP rule is exactly from Theorem 2: predict 1 iff . With a uniform prior, MAP and ML coincide.
Approach 4: take the costs of errors into account
Slide 95
Bayes decision rule
- A loss says how much we lose by predicting when the true label is .
- The conditional risk at is the expected loss when predicting (randomness only in the true label of ):
- Bayes decision rule: select the label for which the conditional risk is minimal.
For two classes write for the loss of predicting when the truth is (correct predictions cost 0). Then is the cost of missing a 1 and the cost of a false 1:
Two-class Bayes decision rule (the one formula for the exam)
Predict 1 iff , equivalently
- 0-1 loss (): MAP, threshold .
- additionally uniform prior: ML, likelihood ratio .
- The decision boundaries are the points where : where the two weighted curves cross.
With the mock exam’s notation , this is .
flowchart LR A["priors P(Y)"] --> R1["Approach 1: larger class"] B["likelihoods P(X|Y)"] --> R2["Approach 2: maximum likelihood"] A & B --> C["posterior P(Y|X) (Bayes rule)"] --> R3["Approach 3: MAP = Bayes classifier for 0-1 loss"] C & D["costs ℓ"] --> R4["Approach 4: Bayes decision rule, minimal conditional risk"]
Which way does the boundary move?
Increasing or makes class 1 “cheaper to predict”: the region where we predict 1 grows, and the boundary moves towards class 0. On the slides: with prior the threshold moves from about 172 cm to about 160 cm, and people are called male at smaller heights.
Simulations: the lecturer’s demo
Slides 96-104
The slides show simulations (script demo_bayesian_decision_theory.py) for the stylized model height, gender. Each panel shows: class conditionals , priors , marginal , posteriors , the loss weights, the pointwise risk and the overall risk of a threshold (everybody with height is predicted female).


| Slide | Priors | Losses , | Optimal threshold |
|---|---|---|---|
| 97 | 0.5, 0.5 | 1, 1 | in the middle (≈ 172 cm) |
| 98 | 0.2, 0.8 | 1, 1 | lower (≈ 160 cm): more people are called male |
| 99 | 0.5, 0.5 | 0.5, 2 | lower: missing a male is expensive |
| 100 | 0.2, 0.8 | 0.5, 2 | much lower: both effects push the same way |
| 101 | 0.2, 0.8 | 2, 0.5 | back up (≈ 172 cm): prior and costs cancel |
On slide 101 the effects cancel exactly: , so the weighted curves are the unweighted ones scaled by the same factor.
Risk of a threshold rule (slides 102-104)
With “predict iff ”, all males below and all females above are misclassified:
where is the loss for predicting when the truth is , and the marginal density.
Trap
The slides write this in short form as and . Written out exactly, the probabilities are joint probabilities, and inside the integral the posterior is weighted with the marginal density . Equivalently, .
Reading decision boundaries off a diagram
This section is exam training for the real exam’s Bayes task: you get a diagram of the class-conditional densities (often boxes or triangles, sometimes Gaussians) and have to determine the decision rule mathematically.
Recipe
- Read the densities and off the diagram and write them as formulas on each piece where they are non-zero.
- Weight them: and . (ML: no weights. MAP: priors only.)
- Where only one class has density, predict that class. In the overlap, predict 1 where .
- Boundary: solve on the overlap (constant pieces: compare heights; linear pieces: a linear equation; Gaussians with equal variance: a linear equation in after taking logs).
- Error of the rule: integrate the smaller weighted curve, (with only, without costs, for the 0-1 error).
- Backwards: plug the given boundary into and solve for the unknown prior or cost ratio.
Exam-style task: boxes (4 P)
![]()
(a) (1 P, easy) Give the maximum likelihood decision rule.
(b) (1.5 P, harder) Let and use the 0-1 loss. Give the Bayes classifier and its error.
(c) (1.5 P, backwards) For which priors does the 0-1 Bayes classifier predict 1 on ? With a uniform prior instead, which cost ratio achieves the same?
Solution
(a) On only class 0 has density: predict 0. On : : predict 0. On only class 1: predict 1. So iff . (1 P)
(b) On : : predict 1. So iff (1 P). Error: only on the overlap, where the smaller weighted curve is : . (0.5 P)
(c) Predict 1 on iff (at both labels are optimal on ). (1 P) Uniform prior: iff . (0.5 P)
Exam-style task: triangles (4 P)
![]()
(a) (1 P, easy) Write down both densities on the overlap and give the ML boundary.
(b) (1.5 P, harder) Let with the 0-1 loss. Compute the Bayes boundary and the Bayes error.
(c) (1.5 P, backwards) The 0-1 Bayes classifier has its boundary at . Which prior was used?
Solution
(a) On the red triangle falls from to 0 and the blue one rises from 0 to : , . ML boundary: . (1 P)
(b) (0.75 P). Error: class-1 mass left of plus class-0 mass right of : . (0.75 P)
(c) At : . The boundary moved towards class 0, so class 1 must be more likely. (1.5 P)
Exam-style task: Gaussians with equal variance (4 P)
with , , .
(a) (1 P, easy) Give the boundary for the uniform prior and the 0-1 loss.
(b) (1.5 P, harder) Show that in general the boundary is and evaluate it for with the 0-1 loss.
(c) (1.5 P, backwards) With a uniform prior the observed boundary is . What cost ratio was used? Interpret.
Solution
(a) By symmetry, where the two bell curves cross: . (1 P)
(b) Predict 1 iff . The normalizing constants cancel, and , so the condition is , which for gives with the formula above (1 P). For : . (0.5 P)
(c) . Missing a 1 costs about 2.7 times as much as a false 1, so the rule predicts 1 already from on. (1.5 P)
Unequal variances
If , the log-likelihood ratio is quadratic in and there can be two boundaries: the class with the wider density wins on both sides. Then no single threshold is optimal. Try the preset “Unequal spreads” in the explorer above.
Exam-style task: three classes (4 P)
Three classes with box densities: on , on , on .
(a) (1 P) Give the ML rule on .
(b) (1.5 P) Priors , , , 0-1 loss. Give the MAP rule.
(c) (1.5 P) With the uniform prior, give a loss that makes the Bayes rule never predict .
Solution
(a) : only A. : , A. : only B. : , C. : only C. So A on , B on , C on . (1 P)
(b) Weighted heights: A , B , C . On : B beats A. On : B beats C. So A on , B on , C on . (1.5 P)
(c) Make predicting very expensive: loss for predicting when the truth is A or C (large , also ), 1 for all other errors. The conditional risk of predicting B is , which is larger than the risk of A or C (at most 1) wherever another class has density. This is the idea of Sheet 1, Exercise 2(c). (1.5 P)
Summary
| Approach | Uses | Rule (two classes) | Boundary where |
|---|---|---|---|
| 1. Priors only | larger class, always | no boundary | |
| 2. Maximum likelihood | class conditionals cross | ||
| 3. MAP (= 0-1 Bayes classifier) | , | ||
| 4. Bayes decision rule | posterior and costs |
| Loss | Bayes predictor | Bayes risk |
|---|---|---|
| 0-1 | ||
| squared (regression) | ||
| hinge, squared, exponential, logistic (scores) | see the table above | thresholded: same classifier as 0-1 |
Self-Test
Question cards (14)
What is the difference between deductive and inductive inference, and what does it have to do with machine learning?
Answer
Deduction goes from general premises to certain conclusions; induction generalizes from specific examples, and the conclusion can be wrong. Machine learning tries to automate inductive inference.
What is an inductive bias, and why can no learning algorithm work without one?
Answer
An idea of what we are looking for, for example that is periodic, simple, or that similar inputs have similar outputs. Finitely many data points are fit by infinitely many functions (slide 41), so without a preference among them nothing can be predicted at a new point.
Besides an inductive bias, what else is needed for learning?
Answer
A signal: the input must contain information about the output. If is produced by a random number generator independent of , no prediction at is better than any other.
Define the true risk, the Bayes risk and the Bayes classifier.
Answer
with . over all measurable . If the infimum is attained, a minimizer is a Bayes classifier; it need not be unique.
What is the regression function in binary classification, and what does it say about how hard a point is?
Answer
. Near 0 or 1 the label is almost determined (easy), near 0.5 both labels are equally likely (hard). Together with the marginal it determines uniquely (Proposition 1).
State Theorem 2 and explain why it does not help in practice.
Answer
For the 0-1 loss, satisfies for every classifier , so it is a Bayes classifier. In practice is unknown; we only have a sample.
Sketch the proof of Theorem 2.
Answer
Pointwise error of any : . The difference to is , because both factors have the same sign. Taking the expectation over gives .
What is the Bayes error for the 0-1 loss as a formula?
Answer
; for discrete , .
Why use surrogate losses and scoring functions instead of the 0-1 loss, and what does "classification-calibrated" mean?
Answer
The 0-1 loss is not continuous and not convex, so it is hard to optimize. Surrogate losses on real scores (hinge, squared, exponential, logistic) are convex. Classification-calibrated: the sign of the loss’s Bayes predictor equals the 0-1 Bayes classifier, even though the scores themselves differ.
Derive the Bayes predictor for the exponential loss.
Answer
. Setting the derivative to 0 gives , so ; the function is convex, so it is the global minimum, and iff .
What is the Bayes predictor for regression with the squared loss, and why?
Answer
. By Proposition 3, ; the second term does not depend on , the first is 0 for . The Bayes risk is .
Name the four approaches of decision theory and when two of them coincide.
Answer
Priors only, maximum likelihood, maximum a posteriori, and the Bayes decision rule with costs. MAP = ML for a uniform prior; the Bayes decision rule = MAP for the 0-1 loss.
Derive the two-class Bayes decision rule with costs (miss a 1) and (false 1).
Answer
and . Predict 1 iff , i.e. , equivalently .
How do you get a prior from a given decision boundary (0-1 loss)?
Answer
At the boundary the weighted densities are equal: . Solve for . With costs and a uniform prior, solve for the cost ratio instead.
Multiple Choice
Multiple choice (7)
Under the 0-1 loss, which classifier is a Bayes classifier?
iff
iff
iff
iff
Explanation
Theorem 2: threshold the posterior at . The first option is the ML rule; it ignores the prior and is only optimal for a uniform prior. The third ignores (approach 1). The fourth compares two unrelated quantities.
Let be the cost of predicting 0 when and the cost of predicting 1 when . The Bayes decision rule predicts 1 iff
Explanation
The threshold is . Missing a 1 is expensive, so we predict 1 already at small posteriors. swaps the roles of the costs, forgets to add in the denominator.
When do the maximum likelihood rule and the MAP rule always coincide?
when the class conditionals are Gaussian
when the prior is uniform
when the loss is the 0-1 loss
when both class conditionals have the same variance
Explanation
MAP compares , ML compares . They agree for all densities iff all are equal. The 0-1 loss is what makes MAP the Bayes classifier, not what makes it equal to ML. Equal variances only make the boundary a single point; a non-uniform prior still shifts it.
Which statement about the squared loss in regression is true?
The Bayes predictor is the conditional median of given .
The Bayes risk equals .
The Bayes risk is 0 if is linear.
holds with strict inequality in general.
Explanation
Theorem 4: the Bayes predictor is the conditional mean (the median belongs to the absolute loss), and the remaining risk is the conditional variance. The risk is 0 only without noise, independent of the shape of . Proposition 3 is an equality.
The hinge, squared, exponential and logistic losses are classification-calibrated. This means:
they all have the same Bayes predictor
is the 0-1 Bayes classifier for each of them
each of them has the Bayes predictor
their Bayes risk equals the 0-1 Bayes risk
Explanation
The Bayes predictors differ ( only for the squared loss, for the exponential loss, …), but after thresholding at 0 they all give iff . The risks are measured in different losses, so their Bayes risks are different numbers.
Two classes, 0-1 loss. You increase the prior of class 1. What happens to the MAP decision region of class 1?
it grows, the boundary moves towards class 0
it shrinks, the boundary moves towards class 1
it stays the same, because the likelihoods did not change
it grows only if the class conditionals are Gaussian
Explanation
Class 1 wins where . A larger scales up the left side everywhere, so the region grows for any shape of densities. Only ML ignores the prior.
Box densities: on , on , 0-1 loss. For which prior does the Bayes classifier predict 1 on ?
never, because there
Explanation
. The last option is the ML answer, which ignores the prior.
References
All sources cited on the slides, in slide order (16 entries)
Slide Source Key point 6 Hardt and Recht, Patterns, Predictions, and Actions, 2022, introduction (online) history of AI and ML 11 Minsky and Papert, Perceptrons, 1969 single-layer perceptrons cannot learn XOR 12 Lighthill, Artificial Intelligence: A General Survey (Lighthill Report), 1973 AI winter 22 Vaswani et al., “Attention Is All You Need”, NeurIPS 2017 transformers 32 Hardt and Recht, Patterns, Predictions, and Actions, 2022 (online) main textbook 32 Shalev-Shwartz and Ben-David, Understanding Machine Learning, 2014 (online) main textbook 32 Bach, Learning Theory from First Principles, 2024 additional textbook 32 Hastie, Tibshirani and Friedman, The Elements of Statistical Learning (online) additional textbook 32 Mohri, Rostamizadeh and Talwalkar, Foundations of Machine Learning additional textbook 32 Hardt, The Emerging Science of Machine Learning Benchmarks book on benchmarks (online PDF) 32 Devroye, Györfi and Lugosi, A Probabilistic Theory of Pattern Recognition, 1996 additional textbook 42, 46 Garcia, Brett and Rusiniak, “Limits of Darwinian conditioning”, in Contemporary Learning Theories, 1989, pp. 181-204 Garcia effect: inductive bias in rats 49 Bach Sec. 2; Devroye et al. Sec. 2; Hastie et al. Sec. 2.4-2.9 reading for the statistical setup 62 Devroye, Györfi and Lugosi, first pages formal proof of Proposition 1 81 Györfi, Kohler, Krzyżak and Walk, A Distribution-Free Theory of Nonparametric Regression, p. 2 proof of Proposition 3 85 Hastie et al. Sec. 2.4-2.9; Devroye et al. Sec. 2 reading for decision theory
Related
- Next: Lecture 1.2: Learning from Finite Samples · Course: Overview
- Concepts: Inductive Bias, Loss and Risk, Bayes Classifier, Bayesian Decision Theory, Surrogate Loss
- Exercises: Sheet 1, Exercise 2 (Bayesian decision theory with three classes) and Exercise 3 (Bayes predictor for the squared loss)