Example usage for weka.classifiers.trees.j48 C45PruneableClassifierTree C45PruneableClassifierTree

List of usage examples for weka.classifiers.trees.j48 C45PruneableClassifierTree C45PruneableClassifierTree

Introduction

In this page you can find the example usage for weka.classifiers.trees.j48 C45PruneableClassifierTree C45PruneableClassifierTree.

Prototype

public C45PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, float cf,
        boolean raiseTree, boolean cleanup, boolean collapseTree) throws Exception 

Source Link

Document

Constructor for pruneable tree structure.

Usage

From source file:marytts.tools.voiceimport.PauseDurationTrainer.java

License:Open Source License

private StringPredictionTree trainTree(Instances data, FeatureDefinition fd) throws Exception {

    System.out.println("training duration tree (" + data.numInstances() + " instances) ...");

    // build the tree without using the J48 wrapper class
    // standard parameters are:
    // binary split selection with minimum x instances at the leaves, tree is pruned, confidence value, subtree raising,
    // cleanup, don't collapse
    C45PruneableClassifierTree decisionTree = new C45PruneableClassifierTree(
            new BinC45ModelSelection(2, data, true), true, 0.25f, true, true, false);

    decisionTree.buildClassifier(data);/*w w w  . j  a v a  2 s  . c  om*/

    System.out.println("...done");

    return TreeConverter.c45toStringPredictionTree(decisionTree, fd, data);
}