Class C45

  • All Implemented Interfaces:
    java.lang.Comparable<C45>

    public class C45
    extends java.lang.Object
    implements java.lang.Comparable<C45>
    TODO: missing values.
    • Field Detail

      • error

        protected double error
      • backedUpError

        protected double backedUpError
      • mostCommonLeaf

        protected Attribute mostCommonLeaf
      • mostCommonLeafFreq

        protected int mostCommonLeafFreq
      • samplesCount

        protected int samplesCount
      • samplesFreq

        protected java.util.HashMap<Attribute,java.lang.Integer> samplesFreq
      • confidence

        protected double confidence
      • z

        protected double z
      • good

        protected int good
      • bad

        protected int bad
    • Method Detail

      • getInstance

        public static C45 getInstance​(java.io.File path)
      • getInstance

        public static C45 getInstance​(DataSet ds)
        Return an unpruned tree from the given dataset.
        Parameters:
        ds - ds
        Returns:
        unpruned tree from the given dataset
      • getInstancePrune

        public static C45 getInstancePrune​(DataSet ds,
                                           int type)
        Return a pruned tree from the given dataset using the standard confidence of 25%
        Parameters:
        ds - ds
        type - type
        Returns:
        pruned tree from the given dataset using the standard confidence
      • getInstancePrune

        public static C45 getInstancePrune​(DataSet ds,
                                           double confidence)
        Return a pruned tree from the given dataset using the specified confidence.
        Parameters:
        ds - ds
        confidence - confidence
        Returns:
        pruned tree from the given dataset using the specified
      • isLeaf

        public boolean isLeaf()
      • error

        public double error​(DataSet ds)
      • prune

        public C45 prune​(DataSet ds,
                         int type)
      • setConfidence

        public void setConfidence​(double c)
      • load

        protected C45 load​(org.w3c.dom.Node root)
        Load a new C45 tree from the XML node root.
        Parameters:
        root - root
        Returns:
        new C45 tree from the XML node root
      • save

        public boolean save​(java.io.File path)
      • print

        public void print()
        Print the tree over the standard output. Alias for print("")
      • compareTo

        public int compareTo​(C45 o)
        Dummy function, just needed to be able to use the Pair structure.
        Specified by:
        compareTo in interface java.lang.Comparable<C45>
        Parameters:
        o - the other object
        Returns:
        always 0.