LinearSVC() 与 SVC(kernel='linear') 的区别概括如下:
LinearSVC() 最小化 hinge loss的平方,
SVC(kernel='linear') 最小化 hinge loss;
LinearSVC() 使用 one-vs-rest 处理多类问题,
SVC(kernel='linear') 使用 one-vs-one 处理多类问题;
LinearSVC() 使用linear执行,
SVC(kernel='linear')使用libsvm执行;
LinearSVC() 可以选择正则项和损失函数,
SVC(kernel='linear')使用默认设置。
LinearSVC
sklearn.svm.LinearSVC(penalty='l2', loss='squared_hinge', dual=True, tol=0.0001, C=1.0, multi_class='ovr', fit_intercept=True, intercept_scaling=1, class_weight=None, verbose=0, random_state=None, max_iter=1000)
loss:string, ‘hinge’ or ‘squared_hinge’ (default=’squared_hinge’)
penalty : string, ‘l1’ or ‘l2’ (default=’l2’)
注意:底