简体   繁体   English

在python中使用SVM的回归置信度

[英]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. 我在python中使用回归SVM,我想知道是否有任何方法可以为其预测获取“置信度”值。

Previously, when using SVMs for binary classification, I was able to compute a confidence-type value from the 'margin'. 以前,使用SVM进行二进制分类时,我能够从'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: 我的(高级)问题如下:

  • I have a function F(x), where x is a high-dimensional vector 我有一个函数F(x),其中x是高维向量
  • F(x) can be computed but it is very slow F(x)可以计算,但是非常慢
  • I want to train a regression SVM to approximate it 我想训练回归SVM使其近似
  • If I can find values of 'x' that have low prediction confidence, I can add these points and retrain (aka. active learning) 如果我可以找到预测信心较低的'x'值,则可以添加这些点并进行重新训练(又称主动学习)

Has anyone obtained/used regression-SVM confidence/margin values before? 之前有没有人获得/使用过回归-SVM置信度/边距值?

Have a look at this similar response on Stack back in January. 看看一月份在Stack上的类似反应。 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库可能是不可能的: 在libsvm(python)中最好选择一个类

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM