Akshay Ram
Akshay Ram

Reputation: 25

sklearn SVM default distance measurement

SVM uses a distance measure in the algorithm, What is the default distance measurement used in sklearn SVM ?

Is it possible to change it ?

Upvotes: 0

Views: 252

Answers (1)

glemaitre
glemaitre

Reputation: 1003

SVM is minimizing the [Hinge loss][1]. You cannot change the loss otherwise this is not an SVM anymore (e.g. log loss will give rise to logistic regression). However, you can make use of kernels via the kernel tricks (look a the kernel parameters in sklearn.svm.SVC)

If you want an estimator for which you can change the loss, you can use sklearn.linear_model.SGDClassifier.

Upvotes: 1

Related Questions