Package weka.classifiers.trees
Class RandomRegressionForest.Node
- java.lang.Object
-
- weka.classifiers.trees.RandomRegressionForest.Node
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- RandomRegressionForest
public class RandomRegressionForest.Node extends Object implements Serializable
TODO: description of class- Version:
- $Revision$
- Author:
- Bernhard Pfahringer ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RandomRegressionForest.Nodem_Lessprotected LinearRegressionJm_LinearRegprotected RandomRegressionForest.Nodem_Moreprotected intm_SplitIndexprotected doublem_SplitValue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleclassifyInstance(weka.core.Instance instance)classifies the given instancevoidfindRandomSplit(weka.core.Instances data, Random r, int min)determines a random split for the data, tries 10 pairs.voidprefix(int indent, StringBuffer sb)generates the tree structure prefixbooleansubsetSizesOK(weka.core.Instances data, int min)tests whether the leaf threshold is OKvoidtoString(int indent, StringBuffer sb, List<String> models)Generates a string representation of the node.voidturnIntoLeaf(weka.core.Instances data)turns the node into a leaf
-
-
-
Field Detail
-
m_SplitValue
protected double m_SplitValue
-
m_SplitIndex
protected int m_SplitIndex
-
m_LinearReg
protected LinearRegressionJ m_LinearReg
-
m_Less
protected RandomRegressionForest.Node m_Less
-
m_More
protected RandomRegressionForest.Node m_More
-
-
Method Detail
-
turnIntoLeaf
public void turnIntoLeaf(weka.core.Instances data) throws Exceptionturns 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 Exceptionclassifies 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 user- the random number generator formin- 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 usemin- 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 depthsb- 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 depthsb- the StringBuffer to add the output tomodels- the list to add the generated output to
-
-