Machine learning 如何从svm_模型中得到决策函数
假设我有一个特征向量Machine learning 如何从svm_模型中得到决策函数,machine-learning,svm,libsvm,Machine Learning,Svm,Libsvm,假设我有一个特征向量[v1,v2,v3], 然后我有一个决策函数a*v1+b*v2+c*v3=d 如何使用svm\u模型中的信息获取值(a、b、c、d) 我在svm\u模型中看到这两个字段 public double[][] sv_coef;// coefficients for SVs in decision functions (sv_coef[k-1][l]) public double[] rho;// constants in decision functions (rho[k*(k-
[v1,v2,v3]
,
然后我有一个决策函数a*v1+b*v2+c*v3=d
如何使用svm\u模型中的信息获取值(a、b、c、d)
我在svm\u模型中看到这两个字段
public double[][] sv_coef;// coefficients for SVs in decision functions (sv_coef[k-1][l])
public double[] rho;// constants in decision functions (rho[k*(k-1)/2])
我怀疑这可能是获得决策函数的必要条件。在svm\u模型中还有一个SVs
字段。您的决策函数是wv+b=0
,其中v=[v1、v2、v3]
。那么
w = SVs' * msv_coef;
b = -.rho;
对于多类SVM,您可能还需要另一个名为Label
if Label(1) == -1
w = -w;
b = -b;
end
查看零件以了解更多详细信息