|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.antree.representation.Tree
public class Tree
Nested Class Summary | |
---|---|
static class |
Tree.DefaultGatherer
|
Constructor Summary | |
---|---|
Tree()
Default constructor. |
|
Tree(Node root)
Creates a new tree. |
Method Summary | |
---|---|
void |
adjust(net.sf.myra.datamining.data.Dataset dataset)
Adjust the leaf node predictions based on the specified data set. |
net.sf.myra.datamining.data.Label |
classify(net.sf.myra.datamining.data.Instance instance)
Returns the label predicted for the specified instance. |
Tree |
clone()
|
int |
countInternalNodes()
Returns the number of leaf nodes of the tree. |
int |
countLeaves()
Returns the number of leaf nodes of the tree. |
Statistics |
gather(net.sf.myra.datamining.data.Dataset dataset)
Computes the nodes statistics. |
Node |
get(int index)
Returns a node of the tree specified by its index. |
Branch |
getBranch(Node node)
Returns the branch leading to the specified node. |
net.sf.myra.datamining.Gatherer |
getGatherer()
|
int |
getIndex(Node node)
Returns the index of the specified node. |
net.sf.myra.datamining.Unit<?> |
getQuality()
Returns the quality of the tree. |
Node |
getRoot()
Returns the root of the tree. |
java.util.Collection<java.lang.Integer> |
indexes(java.lang.Class<? extends Node> type)
Returns the indexes of nodes. |
java.util.Collection<LeafNode> |
leaves()
Returns the number of leaf nodes of the tree. |
void |
setQuality(net.sf.myra.datamining.Unit<?> quality)
Sets the quality of the tree. |
void |
setRoot(Node root)
Sets the root node of the tree. |
void |
setStatistics(Statistics statistics)
Sets the nodes statistics to be used to deal with missing values. |
int |
size()
Returns the number of nodes of the tree. |
net.sf.myra.datamining.model.RuleSet |
toRuleSet(net.sf.myra.datamining.data.Metadata metadata)
Returns the tree represented as a set of rules. |
java.lang.String |
toString()
|
java.lang.String |
toString(Statistics statistics)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Tree()
public Tree(Node root)
root
- the root node of the tree.Method Detail |
---|
public void setRoot(Node root)
root
- the root node to set.public Node getRoot()
public void setStatistics(Statistics statistics)
statistics
- the statistics to set.public Node get(int index)
index
- the node index.
public int getIndex(Node node)
node
- the node to look for the index.
public Branch getBranch(Node node)
node
- the node at the end of the branch.
public java.util.Collection<java.lang.Integer> indexes(java.lang.Class<? extends Node> type)
type
- the type of the nodes.
public void adjust(net.sf.myra.datamining.data.Dataset dataset)
dataset
- the current data set.public net.sf.myra.datamining.Unit<?> getQuality()
public void setQuality(net.sf.myra.datamining.Unit<?> quality)
quality
- the quality to set.public int size()
public int countInternalNodes()
public int countLeaves()
public java.util.Collection<LeafNode> leaves()
public net.sf.myra.datamining.data.Label classify(net.sf.myra.datamining.data.Instance instance)
classify
in interface net.sf.myra.datamining.Model
instance
- the instance to classify.
public Statistics gather(net.sf.myra.datamining.data.Dataset dataset)
dataset
- the current dataset.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Statistics statistics)
public net.sf.myra.datamining.model.RuleSet toRuleSet(net.sf.myra.datamining.data.Metadata metadata)
metadata
- the data set metadata.
Rule
public Tree clone()
clone
in class java.lang.Object
public net.sf.myra.datamining.Gatherer getGatherer()
getGatherer
in interface net.sf.myra.datamining.Model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |