Class YongSplitInfo

    • Constructor Detail

      • YongSplitInfo

        public YongSplitInfo​(int low,
                             int high,
                             int attr)
        Constructs an object which contains the split information
        Parameters:
        low - the index of the first instance
        high - the index of the last instance
        attr - an attribute
    • Method Detail

      • initialize

        public final void initialize​(int low,
                                     int high,
                                     int attr)
        Resets the object of split information
        Parameters:
        low - the index of the first instance
        high - the index of the last instance
        attr - the attribute
      • toString

        public final String toString​(Instances inst)
        Converts the spliting information to string
        Parameters:
        inst - the instances
      • attrSplit

        public final void attrSplit​(int attr,
                                    Instances inst)
                             throws Exception
        Finds the best splitting point for an attribute in the instances
        Specified by:
        attrSplit in interface SplitEvaluate
        Parameters:
        attr - the splitting attribute
        inst - the instances
        Throws:
        Exception - if something goes wrong
      • maxImpurity

        public double maxImpurity()
        Returns the impurity of this split
        Specified by:
        maxImpurity in interface SplitEvaluate
        Returns:
        the impurity of this split
      • splitAttr

        public int splitAttr()
        Returns the attribute used in this split
        Specified by:
        splitAttr in interface SplitEvaluate
        Returns:
        the attribute used in this split
      • position

        public int position()
        Returns the position of the split in the sorted values. -1 indicates that a split could not be found.
        Specified by:
        position in interface SplitEvaluate
        Returns:
        an int value
      • splitValue

        public double splitValue()
        Returns the split value
        Specified by:
        splitValue in interface SplitEvaluate
        Returns:
        the split value