I have a hard time intuitively understand the Bayer error in the context of supervised learning. We have an input X and an output Y. We want to find the function f(X) = Y.
I feel like I don't understand why we model X as a random variable in the first place. I think we construct the function f not based on the distribution of X but rather on actual values of X. Why should we care if X is stochastic or not?
Example I: Let's say X = [1,2,3], Y = [1,2,3] and f(x) = x. When X=1 => Y=1, X=2 => Y=2, X=3 => Y=3, I will never make an error.
Example II: Why should it be different if X = [picture of dog, picture of cat, picture of house] and Y = [dog, cat, house]. I can still find a function which does the mapping. It is obviously more complex but doable.
Where did the Bayes error get lost in my examples?
I am looking for an intuitive explanation of the Bayes error preferably in the context of image classification.