How can OneVsRestClassifier distinguish a multilabel problem from ordinary multiclass labels?
Classic MLLevel: IntermediateMultilabel indicator routing
How can OneVsRestClassifier distinguish a multilabel problem from ordinary multiclass labels?
Hints
- Inspect y's structure, not only the estimator name.
- Matrix columns represent independent membership decisions.
Answer
Supply a binary indicator matrix with one column per possible label. A single vector of class IDs instead expresses one label per sample, so these encodings are not interchangeable.
Source and licence: scikit-learn 1.7.2 — multiclass · BSD-3-Clause · answer: Quantoros editorial