Re: Confusion Matrix in Weka Experiments
Peter Reutemann <[email protected]>
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12JCB6eLKXm2i=vHTZ1CFqXwGea0=0pkLsCNH_H02mxwUw@mail.gmail.com> |
> Hi, I am trying to conduct experiments to compare the performance of several classifiers on several datasets. It works well. However I can not get any confusion matrix of the classifications as we get in the explorer. Is there a way to get an output with all confusion matrices ?
>
> I also tried this code: https://waikato.github.io/weka-wiki/files/ExperimentDemo.java on Java but I do not know how to write the confusion matrices with that as well. Also it does not allow me to use several classifiers and to compare them.
I've answered this on stackoverflow already:
https://stackoverflow.com/a/72482288/4698227:
No, Weka's Experiment API does not store the confusion matrix. You can
see for yourself in the source code by inspecting the responsible
class: weka.experiment.ClassifierSplitEvaluator. However, you can
store targets and predictions in the results
(ClassifierSplitEvaluator.setPredTargetColumn(boolean)) and then you
could compute the confusion matrices yourself.
comment to https://stackoverflow.com/a/72454819/4698227:
If you look at the code again, where the classifier is being set, you
can see that the classifier is added as an array
(exp.setPropertyArray(new Classifier[]{c}); ). As the name of the
class suggests, it shows you how to use the Experiment API (which is
not trivial). Just pull out the relevant code bits and create your own
experiment that way.
Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html