What is the difference between SVC and SVM in scikit-learn?

前端 未结 2 683
时光说笑
时光说笑 2021-02-01 15:23

From the documentation scikit-learn implements SVC, NuSVC and LinearSVC which are classes capable of performing multi-class classification on a dataset. By the other hand I also

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-01 16:26

    They are just different implementations of the same algorithm. The SVM module (SVC, NuSVC, etc) is a wrapper around the libsvm library and supports different kernels while LinearSVC is based on liblinear and only supports a linear kernel. So:

    SVC(kernel = 'linear')
    

    is in theory "equivalent" to:

    LinearSVC()
    

    Because the implementations are different in practice you will get different results, the most important ones being that LinearSVC only supports a linear kernel, is faster and can scale a lot better.

提交回复
热议问题