SMO confidence measure in weka

a 夏天 提交于 2019-11-29 22:12:05

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/9686562/smo-confidence-measure-in-weka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!