Ciaran
Ciaran

Reputation: 573

Regression confidence using SVMs in python

I'm using regression SVMs in python and I am wondering if there is any way to get a "confidence-measure" value for its predictions.

Previously, when using SVMs for binary classification, I was able to compute a confidence-type value from the 'margin'. Here is some pseudo-code showing how I got a confidence value:

# Begin pseudo-code
import svm as svmlib

prob = svmlib.svm_problem(labels, data)
param = svmlib.svm_parameter(svm_type=svmlib.C_SVC, kernel_type = svmlib.RBF)
model = svmlib.svm_model(prob, param)

# get confidence
confidence = self.model.predict_values_raw(sample_to_classify)

I imagine that the further the new sample is from the training data, the worse the confidence, but I'm looking for a function that might help compute a reasonable estimate for this.

My (high-level) problem is as follows:

Has anyone obtained/used regression-SVM confidence/margin values before?

Upvotes: 1

Views: 2138

Answers (1)

Marc
Marc

Reputation: 4586

Have a look at this similar response on Stack back in January. The chosen answer was spot on regarding how hard it is to get confidence measures on non-parametric fitting methods. There's probably some Bayesian type thing you could do, but that's probably not possible with the Python SVM library: Prefer one class in libsvm (python).

Upvotes: 1

Related Questions