Example usage for weka.classifiers.trees J48 toSummaryString

List of usage examples for weka.classifiers.trees J48 toSummaryString

Introduction

In this page you can find the example usage for weka.classifiers.trees J48 toSummaryString.

Prototype

@Override
public String toSummaryString() 

Source Link

Document

Returns a superconcise version of the model

Usage

From source file:classif.ExperimentsLauncher.java

License:Open Source License

public void launchJ48() {
    try {/*ww w.  j  a  v a2s . co m*/
        String algo = "J48";
        System.out.println(algo);

        double testError = 0.0;
        J48 dt = new J48();
        dt.buildClassifier(train);
        Evaluation eval = new Evaluation(train);
        eval.evaluateModel(dt, test);
        testError = eval.errorRate();
        System.out.println("TestError:" + testError + "\n");
        System.out.println(dt.toSummaryString());
        System.out.println(dt.graph());
        System.out.println(eval.toSummaryString());

    } catch (Exception e) {
        e.printStackTrace();
    }
}