When I ran the following:
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
clf = SVC(kernel='rbf', probability=True)
clf.fit(x_train, y_train)
I received the ValueError
: The number of classes has to be greater than one; got 1 class
I did: print(np.unique(y_train))
, which returned [0]
.
Can anyone point me in the right direction for a solution?