【发布时间】:2021-07-22 05:36:13
【问题描述】:
当我运行以下内容时:
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)
我收到了 ValueError:The number of classes has to be greater than one; got 1 class
我使用了代码:print(np.unique(y_train)),它返回“[0]”。
谁能指出我正确的解决方案?
【问题讨论】: