svm基础模型搭建
def SVM_Classifier(train, trainLabel,test):clf = svm.SVC(C=1, kernel='rbf', degree=3, gamma='auto', coef0=0.0, shrinking=True,\probability=False, tol=0.001,cache_size=200, class_weight=None, verbose=1
·
def SVM_Classifier(train, trainLabel,test):
clf = svm.SVC(C=1, kernel='rbf', degree=3, gamma='auto', coef0=0.0, shrinking=True,\
probability=False, tol=0.001,cache_size=200, class_weight=None, verbose=1,\
max_iter=-1,decision_function_shape='ovr', random_state=None)
clf.fit(train, trainLabel)
# 在拟合后,这个模型可以用来预测新的分类值
pred = clf.predict(test)
return pred
更多推荐
所有评论(0)