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

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

Introduction

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

Prototype

public PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup,
        int seed) throws Exception 

Source Link

Document

Constructor for pruneable tree structure.

Usage

From source file:j48.J48.java

License:Open Source License

/**
 * Returns default capabilities of the classifier.
 * //from   ww w .  j av  a 2 s  . c o  m
 * @return the capabilities of this classifier
 */
public Capabilities getCapabilities() {
    Capabilities result;

    try {
        if (!m_reducedErrorPruning)
            result = new C45PruneableClassifierTree(null, !m_unpruned, m_CF, m_subtreeRaising, !m_noCleanup)
                    .getCapabilities();
        else
            result = new PruneableClassifierTree(null, !m_unpruned, m_numFolds, !m_noCleanup, m_Seed)
                    .getCapabilities();
    } catch (Exception e) {
        result = new Capabilities(this);
    }

    result.setOwner(this);

    return result;
}

From source file:library.MikeJ48.java

License:Open Source License

/**
 * Returns default capabilities of the classifier.
 *
 * @return      the capabilities of this classifier
 *//*from w  w  w  .ja  va 2 s.  co m*/
public Capabilities getCapabilities() {
    Capabilities result;

    try {
        if (!m_reducedErrorPruning)
            result = new MikeC45PruneableClassifierTree(null, !m_unpruned, m_CF, m_subtreeRaising, !m_noCleanup)
                    .getCapabilities();
        else
            result = new PruneableClassifierTree(null, !m_unpruned, m_numFolds, !m_noCleanup, m_Seed)
                    .getCapabilities();
    } catch (Exception e) {
        result = new Capabilities(this);
    }

    result.setOwner(this);

    return result;
}

From source file:library.MikeJ48.java

License:Open Source License

/**
 * Generates the classifier./*ww w. j  ava2  s  .  co m*/
 *
 * @param instances the data to train the classifier with
 * @throws Exception if classifier can't be built successfully
 */
public void buildClassifier(Instances instances) throws Exception {

    ModelSelection modSelection;

    if (m_binarySplits)
        modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
        modSelection = new C45ModelSelection(m_minNumObj, instances);
    if (!m_reducedErrorPruning)
        m_root = new MikeC45PruneableClassifierTree(modSelection, !m_unpruned, m_CF, m_subtreeRaising,
                !m_noCleanup);
    else
        m_root = new PruneableClassifierTree(modSelection, !m_unpruned, m_numFolds, !m_noCleanup, m_Seed);
    m_root.buildClassifier(instances);
    if (m_binarySplits) {
        ((BinC45ModelSelection) modSelection).cleanup();
    } else {
        ((C45ModelSelection) modSelection).cleanup();
    }
}