Package weka.classifiers.trees

Examples of weka.classifiers.trees.J48


     */
    @Test
    public void testLoad() throws Exception {
        System.out.println("load");

        J48 serializedClassifier = new J48();
        serializedClassifier.setNumFolds(456);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ObjectOutputStream serializer = new ObjectOutputStream(out);
        serializer.writeObject(serializedClassifier);
        out.close();
        byte[] serializedStr = out.toByteArray();

        ByteArrayInputStream in = new ByteArrayInputStream(serializedStr);
        WekaModel model = new WekaModel();
        assertTrue(model.load(in));
        in.close();

        Classifier classifier = model.getClassifier();
        assertTrue(classifier instanceof J48);
        J48 j48 = (J48) classifier;
        assertEquals(serializedClassifier.getNumFolds(), j48.getNumFolds());
    }
View Full Code Here


     */
    @Test
    public void testGetPredictedLabels() {
        System.out.println("getPredictedLabels");

        Classifier classifier = new J48();
        try {
            classifier.buildClassifier(instances);
        } catch (Exception e) {
            assertTrue("Classifier could not be trained", false);
        }

        WekaModel instance = new WekaModel(classifier);
View Full Code Here

       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 C45PruneableClassifierTree(modSelection, !m_unpruned, m_CF,
              m_subtreeRaising, !m_noCleanup);
View Full Code Here

       throws Exception {

    ModelSelection modSelection;

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances);
      m_root = new C45PruneableClassifierTreeG(modSelection,
                              !m_unpruned, m_CF, m_subtreeRaising,
                               m_relabel, !m_noCleanup);
View Full Code Here

      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 C45PruneableClassifierTree( modSelection, !m_unpruned, m_CF,
View Full Code Here

    instances.deleteWithMissingClass();
   
    ModelSelection modSelection;  

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances);
    if (m_unpruned)
      m_root = new MakeDecList(modSelection, m_minNumObj);
    else if (m_reducedErrorPruning)
View Full Code Here

       throws Exception {

    ModelSelection modSelection;

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances);
      m_root = new C45PruneableClassifierTreeG(modSelection,
                              !m_unpruned, m_CF, m_subtreeRaising,
                               m_relabel, !m_noCleanup);
View Full Code Here

    instances.deleteWithMissingClass();
   
    ModelSelection modSelection;  

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances, m_useMDLcorrection);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances, m_useMDLcorrection);
    if (m_unpruned)
      m_root = new MakeDecList(modSelection, m_minNumObj);
    else if (m_reducedErrorPruning)
View Full Code Here

       throws Exception {

    ModelSelection modSelection;  

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances, m_useMDLcorrection);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances, m_useMDLcorrection);
    if (!m_reducedErrorPruning)
      m_root = new C45PruneableClassifierTree(modSelection, !m_unpruned, m_CF,
                                              m_subtreeRaising, !m_noCleanup, m_collapseTree);
View Full Code Here

    ModelSelection modSelection;  

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances);
    if (!m_reducedErrorPruning)
      m_root = new C45PruneableClassifierTree(modSelection, !m_unpruned, m_CF,
              m_subtreeRaising, !m_noCleanup);
    else
      m_root = new PruneableClassifierTree(modSelection, !m_unpruned, m_numFolds,
View Full Code Here

TOP

Related Classes of weka.classifiers.trees.J48

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.