I am stuck on an error when trying to run a multioutput classifier that is using a support vector machine.
The test set y_train_svm looks like this:
array([[1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1],
...,
[1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 0, 1]], dtype=int8)
I already checked the number of classes through np.unique(y_train_svm), which returned array([0, 1]). That should mean that there are actually two classes available?
This is the code for the classifier that returns the error message:
svm_clf = SVC(kernel="linear", random_state=42)
multioutput_classifier = MultiOutputClassifier(estimator=svm_clf)
multioutput_classifier.fit(X_train_svm, y_train_svm)
ValueError: The number of classes has to be greater than one; got 1 class