Reputation: 543
I'm writing a classification code using the smo
class of weka. But what i'm yet to find is a confidence measure of the classification of an instance. It always either returns 0 or 1 when distributionForInstance
is called. I have two classes to be classified into. Any idea how i can get this measure? Thanks.
Upvotes: 4
Views: 897
Reputation: 543
Ok I figured out how to get this in case it might help someone. Get the source code for SMO.java
and add it to your package. Resolve 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 scores instead of a hard 0/1.
Upvotes: 3