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.Node
m_Less
protected LinearRegressionJ
m_LinearReg
protected RandomRegressionForest.Node
m_More
protected int
m_SplitIndex
protected double
m_SplitValue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
classifyInstance(weka.core.Instance instance)
classifies the given instancevoid
findRandomSplit(weka.core.Instances data, Random r, int min)
determines a random split for the data, tries 10 pairs.void
prefix(int indent, StringBuffer sb)
generates the tree structure prefixboolean
subsetSizesOK(weka.core.Instances data, int min)
tests whether the leaf threshold is OKvoid
toString(int indent, StringBuffer sb, List<String> models)
Generates a string representation of the node.void
turnIntoLeaf(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 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 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
-
-