SMO confidence score in weka

I am writing classification code using the smo weka class. But what I have not yet found is a measure of the confidence of classifying an instance. It always either returns 0 or 1 when distributionForInstance is called. I have two classes that need to be classified. Any idea how I can get this measure? Thanks.

+4
source share
1 answer

Ok, I figured out how to do this, if that could help someone. Get the source code for SMO.java and add it to your package. Allow imports, if any. Set m_fitLogisticModels to true . Change smo.buildClassifier(train, cl1, cl2, false, -1, -1); to smo.buildClassifier(train, cl1, cl2, true, -1, -1); . And viola! distributionForInstance returns confidence metrics instead of hard 0/1.

+3
source

Source: https://habr.com/ru/post/1210395/


All Articles