I'm working on a machine learning problem and I met a limit on the number of classes I can run by using MultiOutputClassifier and SVC. In particular, the fit fails when the number of classes>14. I follow the example reported in the MultiOutputClassifier manual page, but using SVC and n_classes=15:
import numpy as np
from sklearn.datasets import make_multilabel_classification
from sklearn.multioutput import MultiOutputClassifier
from sklearn.svm import SVC
X, y = make_multilabel_classification(n_classes=15, random_state=0)
clf = MultiOutputClassifier(SVC()).fit(X, y)
This code fails with the following error message:
"ValueError: The number of classes has to be greater than one; got 1 class"
By using KNeighborsClassifier it does not fail.
What's wrong? how can I make it work?