行搜索在训练ksvm prob.model时失败 [英] Line search fails in training ksvm prob.model

查看:168
本文介绍了行搜索在训练ksvm prob.model时失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

紧随在R中使用ksvm的大型支持向量机的无效概率模型:

我正在使用R中的kernlab软件包中的ksvm来训练SVM.我想使用概率模型,但是在进行S型拟合时,会出现以下错误消息:

I am training an SVM using ksvm from the kernlab package in R. I want to use the probability model, but during the sigmoid fitting I get the following error message:

line search fails -1.833726 0.5772808 5.844462e-05 5.839508e-05 -1.795008e-08 
-1.794263e-08 -2.096847e-12

发生这种情况时,prob.model(m)的结果值是所有概率的向量,而不是适合于这些概率的S形函数的预期参数.是什么导致此错误,我该如何预防?搜索错误消息没有结果.

When this happens, the resulting value of prob.model(m) is a vector of all probabilities, rather than the expected parameters of a sigmoid function fitted over these probabilities. What causes this error and how can I prevent it? Searching for the error message yielded no results.

可复制的示例:

load(url('http://roelandvanbeek.nl/files/df.rdata'))
ksvm(label~value,df[1:1000],C=10,prob.model=TRUE)->m 
prob.model(m) # works as it should, prints a list containing one named list

# the below, non-working problem, unfortunately takes an hour due to the large
# sample size
ksvm(label~value,df,C=10,prob.model=TRUE)->m # line search fails  
prob.model(m) # just a vector of values

推荐答案

查看源代码在方法.probPlatt上,该方法使用牛顿法优化函数,在本例中为Platt的缩放.如果您查看第3007行,尽管您会看到一些与该方法有关的参数.

It's on the method .probPlatt using the Newton method to optimize the function, in this case Platt's scaling. If you check line 3007 though you'll see some parameters pertaining to the method.

此类参数之一是minstep,基本上是该方法应尝试优化功能的最小数值步长.您会看到,这正是3090行中错误的条件:if (stepsize < minstep).因此,基本上,即使达到最小步长,函数也不会收敛.

One of such parameters is minstep basically the minimal numeric step the method should keep trying to optimize the function. You see, this is exactly the condition of the error in line 3090: if (stepsize < minstep). So, basically, the function is not converging, even when reaching the minimum step size.

您可以尝试将minstep更改为较低的值以规避它. Alexandros甚至评论说这些参数可能应该在界面中.

You can try changing minstep to lower values to circumvent it. Alexandros even commented these parameters should probably be in the interface.

这篇关于行搜索在训练ksvm prob.model时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆