Class PruneableClassifierTree

  • All Implemented Interfaces:
    java.io.Serializable, Drawable

    public class PruneableClassifierTree
    extends ClassifierTree
    Class for handling a tree structure that can be pruned using a pruning set.
    Version:
    $Revision: 1.8 $
    Author:
    Eibe Frank (eibe@cs.waikato.ac.nz)
    See Also:
    Serialized Form
    • Field Detail

      • disc

        public static double[][] disc
      • unprunedTreeDisc

        public static double[][] unprunedTreeDisc
      • prunedTreeDisc

        public static double[][] prunedTreeDisc
      • leafRank

        public static double[][] leafRank
      • leafID

        public static int leafID
      • topLeaf

        public static int topLeaf
      • errors

        public static double errors
      • total

        public static double total
      • total_changes

        public static double total_changes
      • dcIndex

        protected int dcIndex
      • ndcIndex

        protected int ndcIndex
      • saDepIndex

        public static int saDepIndex
      • saFavIndex

        public static int saFavIndex
    • Constructor Detail

      • PruneableClassifierTree

        public PruneableClassifierTree​(ModelSelection toSelectLocModel,
                                       boolean pruneTree,
                                       int num,
                                       boolean cleanup,
                                       int seed)
                                throws java.lang.Exception
        Constructor for pruneable tree structure. Stores reference to associated training data at each node.
        Parameters:
        toSelectLocModel - selection method for local splitting model
        pruneTree - true if the tree is to be pruned
        num - number of subsets of equal size
        Throws:
        java.lang.Exception - if something goes wrong
    • Method Detail

      • buildClassifier

        public void buildClassifier​(Instances data)
                             throws java.lang.Exception
        Method for building a pruneable classifier tree.
        Overrides:
        buildClassifier in class ClassifierTree
        Throws:
        java.lang.Exception - if tree can't be built suleafIDessfully
      • setDiscParam

        public static void setDiscParam​(Instances data)
      • removeDisc

        public void removeDisc()
      • changeLeaf

        public void changeLeaf()
      • relabelingTreeGlobally

        public void relabelingTreeGlobally()
      • getDiscForTree

        protected void getDiscForTree()
      • prune

        public void prune()
                   throws java.lang.Exception
        Prunes a tree.
        Throws:
        java.lang.Exception - if tree can't be pruned suleafIDessfully
      • getNewTree

        protected ClassifierTree getNewTree​(Instances train,
                                            Instances test)
                                     throws java.lang.Exception
        Returns a newly created tree.
        Overrides:
        getNewTree in class ClassifierTree
        Parameters:
        data - and selection method for local models.
        Throws:
        java.lang.Exception - if something goes wrong