2014-01-16 55 views
0

我申請SVM加權樣品:SVM輸出誤差僅有時

的代碼是:

clf=svm.SVC(kernel="rbf",gamma = gamma_current, C = 1) 
clf.fit(x_train,y_train,weights) 

一半倍clf.fit運行良好,在控制檯輸出:

clf.fit(x_train,y_train,weights) 
SVC(C=1, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.5, 
kernel='rbf', max_iter=-1, probability=False, random_state=None, 
shrinking=True, tol=0.001, verbose=False) 

,而在其他時間:

clf.fit(x_train,y_train,weights) 

Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "C:\Python27\lib\site-packages\sklearn\svm\base.py", line 178, in fit 
fit(X, y, sample_weight, solver_type, kernel, random_seed=seed) 
File "C:\Python27\lib\site-packages\sklearn\svm\base.py", line 233, in _dense_fit 
max_iter=self.max_iter, random_seed=random_seed) 
File "libsvm.pyx", line 220, in sklearn.svm.libsvm.fit (sklearn\svm\libsvm.c:2532) 
MemoryError 

如何解決這個問題。謝謝

+0

好吧,顯然你已經用完了內存。你可以用'top'來監視內存使用情況。 –

回答