1
$\begingroup$

I know this is a dumb question, but I can not find an answer (I guess everyone else knows this). I want to verify:

When I do k-fold cross validation of a decision tree, the software produces a confusion matrix for the test data. Is each instance assigned the most frequent class in the cross validation results to create the confusion matrix?

$\endgroup$
1
$\begingroup$

During the k runs of a k-fold crossvalidation, for every instance exactly one prediction is made which class the instance belongs to. The prediction is made by the model trained in the particular run.

How the prediction is made depends on the type of model, in case of decision trees the predicted class for an instance is in general the most frequent class in the leaf the particular instance belongs to.

So after the crossvalidation has finished you end up with the known class and the predicted class for every instance from which the confusion matrix can be calculated.

For more information I recommend the slides of Andrew Moore:

$\endgroup$
  • $\begingroup$ Thanks! I had myself confused and the slides were great. $\endgroup$ – Thank you Nov 9 '12 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.