理论篇
实现篇 Python - 调用scikit SVC库函数
from sklearn.svm import SVC
#"linear" accuracy > "rbf"
#C=10000. accuracy > =10.
#C – controls tradeoff between smooth decision boundary and classifying training points correctly
clf = SVC(kernel="rbf",C=10000.0)
clf.fit(features_train, labels_train)
pred = clf.predict(features_test)
from sklearn.metrics import accuracy_score
acc = accuracy_score(pred, labels_test)
print "accuracy:", acc
SVM运行时间明显要比Naive Bayes慢许多,对参数:kernel,C,gamma的依赖性很高。