内核死亡,同时在python中安装SVM模型时重新启动

时间:2018-12-04 09:14:49

标签: python python-3.x machine-learning jupyter-notebook spyder

我已经用python编写了一个程序,该程序可以根据火车数据预测位置名称,但是该程序适用于小型数据集,但是现在我尝试使用大型数据集,但遇到错误Kernel died, restarting

我正在从SQl服务器导入数据。

像内核一样运行时会死model.fit(X_train, y_train)

程序:

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, random_state=0)

from sklearn.svm import LinearSVC
#pipeline of feature engineering and model

from sklearn.calibration import CalibratedClassifierCV
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import FeatureUnion, make_pipeline

from sklearn.model_selection import KFold

word_vectorizer = TfidfVectorizer(ngram_range=(1, 2))
features = FeatureUnion([('words', word_vectorizer), ])

kf = KFold(n_splits=3)

calibrated_svc = CalibratedClassifierCV(LinearSVC(), method='sigmoid', cv=kf)

model = make_pipeline(features, calibrated_svc)

print("Model Created Successfully...")


model.fit(X_train, y_train)

print("Data fitted Successfully...")

运行model.fit(X_train,y_train)

获取错误:An error ocurred while starting the kernel b''

我已经更新了所有库,还重新安装了conda,还安装了mkl,但存在相同的错误。

请建议解决错误

0 个答案:

没有答案