cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.54k stars 1.64k forks source link

How to get the alpha_i * y_i in Libsvm 3.22 ? #91

Open UnbearableFate opened 7 years ago

UnbearableFate commented 7 years ago

as my title says,I want to get the alpha_i y_i in Libsvm 3.22 but don't know how to do it. the sv_coef now is a double[][] array and I can't get a_i y_i just use the model.sv_coef[i] like most past answers I asked the same question in http://stackoverflow.com/q/43348979/3097907 there are some more information there. I hope anyone can help me with this question ,Thank you.

PS: my original problem is solving this Formula gradient(J) = -0.5 X sum(a_i X a_j X y_i X y_j X Km(x_i,x_j) ) (from SimpleMKL formula.11 )