问题
I'm new to WEKA and machine learning in general.
I have a test set with about 6500 instances. I have a model that has already been trained with a training set. Once I run the test set through the saved model, is there a way I can extract the confidence level of each specific instance? By confidence level, I mean a numerical value that expresses the probability that the classifier has classified a specific instance correctly. I want this confidence number for each instance in the file. Is there a way to do that?
回答1:
Using the command line interface, use the -p argument (see here). The example shown in the reference:
java weka.classifiers.bayes.NaiveBayes -K -t soybean-train.arff -T soybean-test.arff -p 0
resulting with:
0 diaporthe-stem-canker 0.9999672587892333 diaporthe-stem-canker
1 diaporthe-stem-canker 0.9999992614503429 diaporthe-stem-canker
2 diaporthe-stem-canker 0.999998948559035 diaporthe-stem-canker
i.e. predicted class and confidence.
来源:https://stackoverflow.com/questions/15487247/the-confidence-level-of-each-specific-instance-in-weka