Solved – Leave-one-out cross-validation misclassification: why is this the answer

cross-validationneural networksself-study

Leave-one-out-cross-validation error… I don't exactly get what is meant with the "error" here. What is the "error"? Could someone explain it? For example, this question is asked, but I don't understand what is being asked. Let's say I take 1-NN, so I'd pick one, and then what?

enter image description here

The answer is given below, but I don't understand how they get to that answer, as I don't understand the question.

Could someone help me out?

Best Answer

In leave one out cross validation we hold each data point out in turn, fit our model on the remaining, and then see how we did on the held out data point. After we've gone through this process for each possible data point, the final score is the proportion of data points that were classified correctly when held out.

1NN:

Whenever we hold out one of the points in the left hand cluster, it get's classified correctly: we held out a -, the nearest point to the held out point is also a -.

In the right hand cluster, we always classify the held out point incorrectly. If the held out point is one of the +'s in the square, the closes by remaining point is a -, so our classification is incorrect. If the held out point is the - in the middle, the closest by point is a +, so we are also incorrect in this case.

Altogether, we incorrectly classified 5 out of the 10 possibilities.

3NN:

Now we are still holding out one datapoint, but are letting the three closest remaining cast a majority vote about how to classify the held out point.

The left hand cluster is more or less the same.

In the right hand cluster, if we hold out any of the +s around the edges, the closest remaining points are a +, a -, and a +, so the majority vote is a +, and we're correct. If we hold out the - in the middle, the tree closest remaining points are all +s, so we classify as a +, which is incorrect.

Altogether we were wrong one out of ten times.