【发布时间】:2016-04-12 15:35:24
【问题描述】:
我正在使用 SVM 执行一些机器学习任务。我怀疑数据是非线性的,所以我还包括了 RBF 内核。我发现带有 RBF 内核的 SVM 比线性 SVM 差得多。我想知道我的分类器参数规范是否有问题。
我的代码如下:
from sklearn.svm import LinearSVC
from sklearn.svm import SVC
svm1 = LinearSVC() # performs the best, similar to logistic regression results which is expected
svm2 = LinearSVC(class_weight="auto") # performs somewhat worse than svm1
svm3 = SVC(kernel='rbf', random_state=0, C=1.0, cache_size=4000, class_weight='balanced') # performs way worse than svm1; takes the longest processing time
svm4 = SVC(kernel='rbf', random_state=0, C=1.0, cache_size=4000) # this is the WORST of all, the classifier simply picks the majority class
【问题讨论】:
标签: python-2.7 machine-learning scikit-learn svm nonlinear-functions