Class RandomRegressionForest.Node

    • Constructor Detail

      • Node

        public Node​(weka.core.Instances data,
                    Random r,
                    int min)
             throws Exception
        the constructor
        Parameters:
        data - the data to use
        r - the random number generator to use
        min - the leaf threshold
        Throws:
        Exception - if something goes wrong
    • Method Detail

      • turnIntoLeaf

        public void turnIntoLeaf​(weka.core.Instances data)
                          throws Exception
        turns the node into a leaf
        Parameters:
        data - the data to use for linear regression
        Throws:
        Exception - if training of LinearRegression fails
      • classifyInstance

        public double classifyInstance​(weka.core.Instance instance)
                                throws Exception
        classifies the given instance
        Parameters:
        instance - the instance to classify
        Returns:
        the regression value
        Throws:
        Exception - if the classification fails
      • findRandomSplit

        public void findRandomSplit​(weka.core.Instances data,
                                    Random r,
                                    int min)
        determines a random split for the data, tries 10 pairs.
        Parameters:
        data - the data to use
        r - the random number generator for
        min - the leaf threshold
        See Also:
        m_SplitIndex, m_SplitValue
      • subsetSizesOK

        public boolean subsetSizesOK​(weka.core.Instances data,
                                     int min)
        tests whether the leaf threshold is OK
        Parameters:
        data - the data to use
        min - the leaf threshold
        Returns:
        true if the size is OK
      • prefix

        public void prefix​(int indent,
                           StringBuffer sb)
        generates the tree structure prefix
        Parameters:
        indent - the depth
        sb - the StringBuffer to add the prefix to
      • toString

        public void toString​(int indent,
                             StringBuffer sb,
                             List<String> models)
        Generates a string representation of the node.
        Parameters:
        indent - the depth
        sb - the StringBuffer to add the output to
        models - the list to add the generated output to