问题描述
我正在python中使用回归SVM,我想知道是否有任何方法可以为其预测获得置信度"值.
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.
以前,当使用SVM进行二进制分类时,我能够从'margin'中计算出一个置信度类型值.这是一些伪代码,显示了我如何获得置信度值:
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:
- 我有一个函数F(x),其中x是一个高维向量
- F(x)可以计算,但是非常慢
- 我想训练回归SVM使其近似
- 如果我能找到预测可信度较低的'x'值,则可以添加这些点并进行重新训练(又称主动学习)
有人曾获得/使用过回归-SVM置信度/边距值吗?
Has anyone obtained/used regression-SVM confidence/margin values before?
推荐答案
回顾一下在一月份Stack上的类似响应.选择的答案是关于在非参数拟合方法上获得置信度度量的难易程度.您可能可以做一些贝叶斯类型的事情,但是使用Python SVM库可能是不可能的:首选libsvm(python)中的一类.
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).
这篇关于在python中使用SVM的回归置信度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!