Menu

Confusion matrix in waffles?

Help
2011-03-30
2012-09-14
  • Nobody/Anonymous

    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

     
  • Mike Gashler

    Mike Gashler - 2011-03-31

    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

     
  • Nobody/Anonymous

    how can get confusion matrix within program?

     
  • Mike Gashler

    Mike Gashler - 2012-07-20

    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*>

     
  • Nobody/Anonymous

    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);

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.