scikit-learn-SVM.fit函数的执行永无止境

时间:2019-01-26 20:44:19

标签: python python-3.x scikit-learn svm

当我调用SVM的fit函数时,其执行永远不会结束,并且相关的Python进程会消耗过多的CPU。

这是我尝试过的:

from sklearn.svm import SVC

x_train, x_test, y_train, y_test = train_test_split(x_values, y_values, test_size=0.3, random_state=42, stratify=y_values)

svm = SVC(kernel='linear')

svm.fit(x_train, y_train) # The execution never ends

y_pred = svm.predict(x_test) # The execution never reaches here

软件堆栈:

 - Python 3.7.0
 - scikit-learn 0.20.2

0 个答案:

没有答案