1

我知道基于一对一方案的多类支持向量机是基于投票方法的。该策略的输出是预测标签。我需要计算分类函数的数量,在二进制情况下,可以通过 f(x)=wx+b 轻松获得。但我的问题是如何为多类问题手动获得 f(x)。它是否类似于只需要从每个问题中提取 W 和 b 然后计算 f(x) 的二元问题?!通过使用 kernlab 的 ksvm 函数,“决定”参数给了我上面提到的数量。如何在不使用 predict 函数的情况下产生这个数量?谢谢!

irismodel <- ksvm(Species~.,data=iris,type="C-bsvc",kernel=rbf,C=10, prob.model=TRUE)

fx<-predict(irismodel, newdata = iris[,-5], type = "decision")
fx
[1,] -1.3982580 -1.1850725 -4.22358404
[2,] -1.2750649 -1.1486247 -4.22523983
[3,] -1.4603977 -1.1910251 -3.88688364
[4,] -1.3718116 -1.1492030 -3.78283230
[5,] -1.4330830 -1.1910482 -3.93300606
[6,] -1.1710980 -1.0910910 -3.83914172
[7,] -1.4290407 -1.1480605 -3.70013283
 .
 .
 .
4

0 回答 0