The input space is often RD, where D is the feature dimension.
The output space can be, say, {0,1} for a classification problem, or R for a regression problem.
There is a training set{(x(n),y(n))}n=1N, where x(n)∈X is the nth input, and y(n) is its output.
There is a decision rule or hypothesish:X→Y inferred from the training set.
There is a loss functionL:Y×Y→R, where L(a,g) is the penalty for guessing g when the answer is a.
Remark. The loss function may be asymmetric; consider, say, email spam detection.
§ The Optimal Hypothesis (Given the Distribution!)
Definition (Risk). A decision rule h has risk defined by risk(h):=E[L(Y,h(X))].
Assume that all data (x(n),y(n)) (training or not) is drawn i.i.d. from the same distribution. Unsurprisingly, if we know this distribution p(x,y) exactly, finding the best h is not hard.
Theorem. (Optimal Hypothesis) Suppose X is discrete and Y={1,…,K}. Then the following minimizes risk:
Proof: Immediate from the definition of risk. You can generalize this to the continuous case if you'd like, too. ■
The optimal h takes a pretty nice form when we consider regression problems with a particular choice of loss. (Refer to Lecture 24 from 18.650 for additional context on why the loss function is what it is.)
Theorem. (Optimal Regression Hypothesis) Assume X=RD, Y=R, and L(a,g)=(a−g)2. Then an optimal decision rule is h(x)=E[Y∣X=x].
Proof: For a particular x, we seek to find the k∈R that minimizes the following “expected cost”: