3
$\begingroup$

I have read about the Platt scaling approach to compute posterior probabilities for the SVM classifier $P(y=1|x)$. In Scikit-learn's SVC (SVM) implementation this is the approach used to produce probabilites. My question is what are the classifier scores $f(x)$?

To make this a bit more confusing the Scikit-learn's SVC has a score function which returns the mean accuracy on the given test data and labels. I'd expect the score $f(x)$ they refer to in the Platt page to be the distance between the classified data point and the SVM decision boundary i.e. how deep in the specific class area that data point is ... or am I missing anything?

$\endgroup$

1 Answer 1

2
$\begingroup$

As far as I can tell, you're basically right.

If we look at the code, we can see that the calibration process directly calls SVC's decision_function method.

SVC's decision_function notes:

If decision_function_shape=’ovo’, the function values are proportional to the distance of the samples $X$ to the separating hyperplane. If the exact distances are required, divide the function values by the norm of the weight vector (coef_). See also this question for further details. If decision_function_shape=’ovr’, the decision function is a monotonic transformation of ovo decision function.

Unfortunately, it's for me hard to tell what exactly is returned from libsvm's decision function method (i.e. $f(x)$)... but it is almost certainly distance from the hyperplane in the binary case, such that $\text{sign}(f(x))$ gives the prediction.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.