Is it possible to get a confusion matrix out of the testing of a model in
waffles? I'd like to know numbers of false positives, false negatives, true
positives and true negatives. Is there any way to do this?
Robin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for pointing this out. I just added this feature. So, you'll need to
get the latest source from our Subversion repository (http://waffles.sourcefo
rge.net/tutorial/subversion.html). Here's an example of using the new feature:
When you call GSupervisedLearner::accuracy, there is an optional parameter
named "pNominalLabelStats". If you pass a pointer to an empty
"vector<gmatrix*>" with this parameter, then it will return a confusion matrix
for each label attribute.</gmatrix*>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Is it possible to get a confusion matrix out of the testing of a model in
waffles? I'd like to know numbers of false positives, false negatives, true
positives and true negatives. Is there any way to do this?
Robin
Thanks for pointing this out. I just added this feature. So, you'll need to
get the latest source from our Subversion repository (http://waffles.sourcefo
rge.net/tutorial/subversion.html). Here's an example of using the new feature:
waffles_learn train iris.arff naivebayes > model.twt
waffles_learn test -confusion model.twt iris.arff
0.97333333333333
(Rows=expected values, Cols=predicted values, Elements=number of occurrences)
Confusion matrix for class Iris-setosaIris-versicoIris-virgini
Iris-setosa 50 0 0
Iris-versicolor 0 48 2
Iris-virginica 0 2 48
how can get confusion matrix within program?
When you call GSupervisedLearner::accuracy, there is an optional parameter
named "pNominalLabelStats". If you pass a pointer to an empty
"vector<gmatrix*>" with this parameter, then it will return a confusion matrix
for each label attribute.</gmatrix*>
if you want see confusion matrix within program u must write a code like:
vector<gmatrix*> confusionMatrices;</gmatrix*>
double* pp;
GTEMPBUF(double, results,punLables->cols());
bool confusion = false;
modell.accuracy(punFeatures, punLables, results, &confusionMatrices);
GVec::print(cout, 14, results,punLables->cols());
cout << "\n";
printConfusionMatrices(punLables->relation().get(), confusionMatrices);