|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.trees.m5.Rule2
public class Rule2
Generates a single m5 tree or rule
| Field Summary | |
|---|---|
protected static int |
LEFT
|
protected RuleNode2 |
m_topOfTree
the top of the m5 tree for this rule |
protected static int |
RIGHT
|
| Constructor Summary | |
|---|---|
Rule2()
Constructor declaration |
|
| Method Summary | |
|---|---|
protected static double |
absDev(int attr,
weka.core.Instances inst)
Returns the absolute deviation value of the supplied attribute index. |
void |
buildClassifier(weka.core.Instances data)
Generates a single rule or m5 model tree. |
double |
classifyInstance(weka.core.Instance instance)
Calculates a prediction for an instance using this rule or M5 model tree |
RuleNode2 |
getM5RootNode()
|
double |
getMinNumInstances()
Get the minimum number of instances to allow at a leaf node |
boolean |
getRegressionTree()
Get the value of regressionTree. |
String |
getRevision()
Returns the revision string. |
boolean |
getSmoothing()
Get whether or not smoothing has been turned on |
boolean |
getUnpruned()
Get whether unpruned tree/rules are being generated |
boolean |
getUseTree()
get whether an m5 tree is being used rather than rules |
weka.core.Instances |
notCoveredInstances()
Get the instances not covered by this rule |
void |
setMinNumInstances(double minNum)
Set the minumum number of instances to allow at a leaf node |
void |
setRegressionTree(boolean newregressionTree)
Set the value of regressionTree. |
protected void |
setSaveInstances(boolean save)
Sets whether instances at each node in an M5 tree should be saved for visualization purposes. |
void |
setSmoothing(boolean s)
Smooth predictions |
void |
setUnpruned(boolean unpruned)
Use unpruned tree/rules |
void |
setUseTree(boolean u)
Use an m5 tree rather than generate rules |
protected static double |
stdDev(int attr,
weka.core.Instances inst)
Returns the standard deviation value of the supplied attribute index. |
RuleNode2 |
topOfTree()
Returns the top of the tree. |
String |
toString()
Return a description of the m5 tree or rule |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int LEFT
protected static int RIGHT
protected RuleNode2 m_topOfTree
| Constructor Detail |
|---|
public Rule2()
| Method Detail |
|---|
public void buildClassifier(weka.core.Instances data)
throws Exception
data - set of instances serving as training data
Exception - if the rule has not been generated
successfully
public double classifyInstance(weka.core.Instance instance)
throws Exception
instance - the instance whos class value is to be predicted
Exception - if a prediction can't be made.public RuleNode2 topOfTree()
public String toString()
toString in class Objectpublic void setUnpruned(boolean unpruned)
unpruned - true if unpruned tree/rules are to be generatedpublic boolean getUnpruned()
public void setUseTree(boolean u)
u - true if m5 tree is to be usedpublic boolean getUseTree()
public void setSmoothing(boolean s)
s - true if smoothing is to be usedpublic boolean getSmoothing()
public weka.core.Instances notCoveredInstances()
protected static final double stdDev(int attr,
weka.core.Instances inst)
attr - an attribute indexinst - the instances
protected static final double absDev(int attr,
weka.core.Instances inst)
attr - an attribute indexinst - the instances
protected void setSaveInstances(boolean save)
save - a boolean valuepublic boolean getRegressionTree()
public void setRegressionTree(boolean newregressionTree)
newregressionTree - Value to assign to regressionTree.public void setMinNumInstances(double minNum)
minNum - the minimum number of instancespublic double getMinNumInstances()
double valuepublic RuleNode2 getM5RootNode()
public String getRevision()
getRevision in interface weka.core.RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||