我正在尝试训练分类器,我的训练日期大约是870,000条记录,并且在调用classifier.fit(X,Y)之后,python脚本总是会被杀死。除了消息" Killed:9"我在控制台中看不到任何内容。我在我的macbook pro上运行这个16GB内存,训练数据非常小,只有90 MB。
对此有任何帮助表示赞赏。
代码:
ASSEMBLY CODE (this is black) ; Assembly comments (this is red) (the rest is black) ASSEMBLY CODE ; Assembly comments
输出:
from sklearn import svm
from sklearn.feature_extraction import DictVectorizer
# train_data is list of dictionaries like
# train_data = [{0:"..", 1:"..", 2:".."}, {...}]
# train_labels = [1, 2, 3, ..]
vect = DictVectorizer(sparse=False)
X = vect.fit_transform(train_data)
Y = train_labels
print "Training model.."
clf = svm.SVC(kernel='linear')
clf.fit(X, Y) # never goes beyond this line
print "Done"
clf.predict(X_test)
我尝试将我的数据集切成两半,但没有运气