Ask Your Question

can't get the trained parameter alpha and rho by any function

asked 2015-09-24 00:38:39 -0500

katharine_fcy gravatar image

updated 2015-09-24 00:45:12 -0500

I have checked that the CvSVM member desicion_func is protected but I want to get the alpha and rho. But I cannot find any function which allows me to do that. I can save the svm parameters to an xml file. and I have tried to create a new class which derive the CvSVM to get the desicion_func but it still didn't work. so the only way is to read the xml file ?

I am using opencv2.4.9 + VS2013

edit retag flag offensive close merge delete



have you considered moving to opencv3 ? (a lot of changes in the ml module, so there will be a lot of changes in your code, too, but at least it is possible to query rho/alpha/decision func )

berak gravatar imageberak ( 2015-09-24 01:14:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-24 04:49:04 -0500

katharine_fcy gravatar image

yes, I have moved to 3.0 and magically I got my problem solved. I have also looked into the source code of 2.4.9, and I found that in the construction function CvSVM::CvSVM(), there is a clear() function that release the decision_func, I am wondering why...

edit flag offensive delete link more


Because for a starter 2.4.9 is auwfully old and deprecated, but like @berak stated, even 2.4.11 does not have it. ML module got a complete overhaul with the new interface of 3.0 and works much more stable now so I would not bother to much with deprecated versions.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-09-24 06:47:21 -0500 )edit

Question Tools

1 follower


Asked: 2015-09-24 00:38:39 -0500

Seen: 205 times

Last updated: Sep 24 '15