Ask Your Question
1

How to get svm predict scores?

asked 2019-11-22 21:16:23 -0500

HelloWorld gravatar image

updated 2019-11-23 00:52:17 -0500

berak gravatar image

image read:

Mat image = imread(buffer, IMREAD_GRAYSCALE);

predict:

SVM->predict(imgDescriptor, testResponse,cv::ml::SVM::UPDATE_MODEL);
cout << "rows: " << testResponse.rows << endl;
cout << "cols: " << testResponse.cols << endl;
cout << "res: " << res << endl;

out put:

rows: 1
cols: 1
res: 0

How to get svm predict socres?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-11-23 01:04:57 -0500

berak gravatar image

you can use:

 svm->predict(vdata, scores, ml::StatModel::RAW_OUTPUT);

note, that this is the distance to the margin, not a probability.

edit flag offensive delete link more

Comments

This doesn't work, I don't know where something went wrong.

HelloWorld gravatar imageHelloWorld ( 2019-11-23 03:02:34 -0500 )edit

doesn't work

never helpful

berak gravatar imageberak ( 2019-11-23 04:42:55 -0500 )edit

i found on document that only some Machine Learning support ouput the distance to the margin

HelloWorld gravatar imageHelloWorld ( 2020-01-22 04:41:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-11-22 21:16:23 -0500

Seen: 99 times

Last updated: Nov 23 '19