0
$\begingroup$

Suppose that I am doing a multiclass classfication problem where some of the classes only occupies a very low percent of the whole training data. It is possible that when I divide it into k folds, some of the folds will not cover all possible labels. What should one do in this case?

$\endgroup$

1 Answer 1

1
$\begingroup$

Yes, it is possible this could happen, especially if you have some classes that have very few representatives. One way to approach it is to do a stratified cross-validation, in which you maintain as closely as possible the relative proportions of each class. There are tools in R and Python that enable this without having to write a lot of extra code yourself. If you have a class that is particularly small, this might be difficult to do, however.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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