当我调用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