Added support for probability inference in ThunderSVMWrapper.
This commit is contained in:
parent
e854036e56
commit
54cc31a1ef
2 changed files with 6 additions and 0 deletions
|
|
@ -149,6 +149,12 @@ extern "C" {
|
||||||
instances.clear();
|
instances.clear();
|
||||||
for (int r = 0; r < rows; r++)
|
for (int r = 0; r < rows; r++)
|
||||||
predictions[r] = (float)predicted[r];
|
predictions[r] = (float)predicted[r];
|
||||||
|
if (probabilities != NULL && sw->param.probability) {
|
||||||
|
vector<float> probs = sw->model->get_prob_predict();
|
||||||
|
for (int r = 0; r < rows; r++)
|
||||||
|
for (int c = 0; c < sw->classes; c++)
|
||||||
|
probabilities[c + r * sw->classes] = probs[c + r * sw->classes];
|
||||||
|
}
|
||||||
predicted.clear();
|
predicted.clear();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue