So I am reading a textbook called "Learning from Data" by Abu Mostafa et al.
I am confused about the following concepts:
According to the authors, most real-world target functions $f$ are not deterministic, such as $f(x) = \sin(x)$, but are noisy. In other words, a noisy target function can be expressed as the summation between a deterministic target function and noise. You can hear the authors say this here. The authors further emphasized that a noisy target function is represented by the probability distribution $P(y|x)$, which is what we are trying to learn.
According to the authors, overfitting is when the model achieves a small training error while having a large test error. The reason is because we are fitting onto the noise. This is undesirable because we are getting a large test error. See here.
Wait a moment...
- Most of the real-world target functions are noisy.
- We are trying to learn target functions (in the real world).
- Overfitting causes the model to fit onto the noise.
But isn't this exactly what we want? We are training a model to fit a noisy target function. Can someone please clarify or resolve this for me?
Some further context directly taken from the Learning from Data textbook:
(P. 31) Noisy Targets: In many practical applications, the data we learn from are not generated by a deterministic target function. Instead, they are generated in a noisy way such that the output is not uniquely determined by the input. For instance, in the credit-card example, two customers may have identical salaries, outstanding loans, etc., but end up with different credit behavior. Therefore, the credit 'function' is not really a deterministic function, but a noisy one.
This situation can be readily modeled within the same framework that we have. Instead of $y = f(x)$, we can take the output $y$ to be a random variable that is affected by, rather than determined by, the input $x$. Formally, we have a target distribution $P(y|x)$ instead of a target function $y = f(x)$. A data point $(x, y)$ is now generated by the joint distribution $P(x, y) = P(x)P(y| x)$.
One can think of a noisy target as a deterministic target plus added noise. If $y$ is real-valued for example, one can take the expected value of $y$ given $x$ to be the deterministic $f(x)$, and consider $y - f(x)$ as pure noise that is added to $f$.
The author emphasized multiple times elsewhere that we need to learn $P(y|x)$, which is the noisy target. Since the noisy target is deterministic target plus noise, therefore learning the noisy target, logically, means learning the noise as well.
The authors then went on saying:
Why does a higher target complexity lead to more overfitting when comparing the same two models? The intuition is that for a given learning model, there is a best approximation to the target function. The part of the target function 'outside' this best fit acts like noise in the data. We can call this deterministic noise to differentiate it from the random stochastic noise. Just as stochastic noise cannot be modeled, the deterministic noise is that part of the target function which cannot be modeled. The learning algorithm should not attempt to fit the noise; however, it cannot distinguish noise from signal. On a finite data set, the algorithm inadvertently uses some of the degrees of freedom to fit the noise, which can result in overfitting and a spurious final hypothesis.