1 | initial version |
Add the second parameter to return the prediction value
decision = svmob.predict(testData, true);
confidence = 1.0 / (1.0 + exp(-decision));
The distance itself is pretty ok, but if you want to have a confidence value in a range (0, 1), you can apply sigmoidal function to the result. One of such functions if logistic function.
2 | No.2 Revision |
Add the second parameter to return the prediction value
decision = svmob.predict(testData, true);
confidence = 1.0 / (1.0 + exp(-decision));
The distance itself is pretty ok, but if you want to have a confidence value in a range (0, 1), you can apply a sigmoidal function to the result. One of such functions if result, which could be a logistic function.
3 | No.3 Revision |
Add the second parameter to return the prediction value
decision = svmob.predict(testData, svm.predict(testData, true);
confidence = 1.0 / (1.0 + exp(-decision));
The distance itself is pretty ok, but if you want to have a confidence value in a range (0, 1), you can apply a sigmoidal function to the result, which could be a logistic function.
4 | No.4 Revision |
Add the second parameter to return the prediction value
decision = svm.predict(testData, true);
confidence = 1.0 / (1.0 + exp(-decision));
The distance itself is pretty ok, but if you want to have a confidence value in a range (0, 1), you can apply a sigmoidal function to the result, which could be a logistic function.
ABOVE WORKS FOR 2.4
THIS WORKS FOR 3.x
svm->predict(data_test, labels_SVM, ml::StatModel::RAW_OUTPUT);