Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AdaBoost ZeroDivisionError #7501
Steps/Code to Reproduce
First, check if the error still exists on the current development version.
IIRC, the behavior is inconsistent. Some classifiers work on a single class, others don't. It's a bit unfortunate. But I don't want to break working behavior for consistencies sake. There is a test that during fit, it either works or a sensible error is thrown:
It seems we should add
For some models, like tree-based ones or knn, fitting to a single class actually has a legitimate result, for others, like linear models, it does not. We could start deprecating the support for single classes, but that's something that could happen within cross-validation. Arguably that will not give you a great result, but that's not really a reason to prohibit the user to do it.