Can somebody explain me why this classifier is giving a loss equal to cero? I don't get the example
SourceText
Can somebody explain me why this classifier is giving a loss equal to cero? I don't get the example
SourceText
The basic setup from this problem is that we draw $n$ data points, where $(x_i, y_i)$ is the $i$th data point from our underlying distrbution $\mathcal{D}$. $x_i$ is the vector of features of the $i$th sample and $y_i$ is its associated label. The point of the passage is that minimizing the empirical risk seems to be an intuitive choice to create a "good" classifier. However, $h_S$ gives an example of where it can go wrong.
Indeed, $h_S$ is just memorizing the training data; i.e. if the input to $h_S$ is $x_i$, which is the vector of features of $i$th data point, then the output will be $y_i$ which is always the correct label. So, the empirical risk when using $h_S$ is always zero, as it outputs the correct label by design. However, it's not hard to see why this is not a good classifier; on unseen data, we always predict 0, without any regard for the data!