Example usage for weka.classifiers Evaluation toClassDetailsString

List of usage examples for weka.classifiers Evaluation toClassDetailsString

Introduction

In this page you can find the example usage for weka.classifiers Evaluation toClassDetailsString.

Prototype

public String toClassDetailsString(String title) throws Exception 

Source Link

Document

Generates a breakdown of the accuracy for each class, incorporating various information-retrieval statistics, such as true/false positive rate, precision/recall/F-Measure.

Usage

From source file:tucil.dua.ai.TucilDuaAi.java

public static void fullTrainingSet() throws Exception {
    Classifier j48 = new J48();
    j48.buildClassifier(datas);/* w w w .j a v a2  s  .com*/

    Evaluation eval = new Evaluation(datas);
    eval.evaluateModel(j48, datas);
    System.out.println("=====Run Information======");
    System.out.println("======Classifier Model======");
    System.out.println(j48.toString());
    System.out.println(eval.toSummaryString("====Stats======\n", false));
    System.out.println(eval.toClassDetailsString("====Detailed Result=====\n"));
    System.out.println(eval.toMatrixString("======Confusion Matrix======\n"));
}

From source file:tucil.dua.ai.TucilDuaAi.java

public static void crossValidation() throws Exception {
    Evaluation evaluation = new Evaluation(datas);
    Classifier attr_tree = new J48();
    attr_tree.buildClassifier(datas);//from  ww w .  j a  v  a  2 s .  c  o  m
    evaluation.crossValidateModel(attr_tree, datas, 10, new Random(1));
    System.out.println("=====Run Information======");
    System.out.println("======Classifier Model======");
    System.out.println(attr_tree.toString());
    System.out.println(evaluation.toSummaryString("====Stats======\n", false));
    System.out.println(evaluation.toClassDetailsString("====Detailed Result=====\n"));
    System.out.println(evaluation.toMatrixString("======Confusion Matrix======\n"));
}