|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.cart.Node
marytts.cart.DecisionNode
public abstract class DecisionNode
A decision node that determines the next Node to go to in the CART. All decision nodes inherit from this class
| Nested Class Summary | |
|---|---|
static class |
DecisionNode.BinaryByteDecisionNode
A binary decision Node that compares two byte values. |
static class |
DecisionNode.BinaryFloatDecisionNode
A binary decision Node that compares two float values. |
static class |
DecisionNode.BinaryShortDecisionNode
A binary decision Node that compares two short values. |
static class |
DecisionNode.ByteDecisionNode
An decision Node with an arbitrary number of daughters. |
static class |
DecisionNode.ShortDecisionNode
An decision Node with an arbitrary number of daughters. |
static class |
DecisionNode.Type
|
| Field Summary | |
|---|---|
protected Node[] |
daughters
|
protected java.lang.String |
feature
|
protected FeatureDefinition |
featureDefinition
|
protected int |
featureIndex
|
protected int |
lastDaughter
|
protected int |
nData
|
protected boolean |
TRACE
|
protected int |
uniqueDecisionNodeId
|
| Fields inherited from class marytts.cart.Node |
|---|
isRoot, mother, nodeIndex |
| Constructor Summary | |
|---|---|
DecisionNode(int numDaughters,
FeatureDefinition featureDefinition)
Construct a new DecisionNode |
|
DecisionNode(int featureIndex,
int numDaughters,
FeatureDefinition featureDefinition)
Construct a new DecisionNode |
|
DecisionNode(java.lang.String feature,
int numDaughters,
FeatureDefinition featureDefinition)
Construct a new DecisionNode |
|
| Method Summary | |
|---|---|
void |
addDaughter(Node daughter)
Add a daughter to the node |
void |
countData()
Set the number of candidates correctly, by counting while walking down the tree. |
protected void |
fillData(java.lang.Object target,
int pos,
int total)
Write this node's data into the target object at pos, making sure that exactly len data are written. |
java.lang.Object |
getAllData()
Get all unit indices from all leaves below this node |
Node |
getDaughter(int index)
Get the daughter at the specified index |
abstract DecisionNode.Type |
getDecisionNodeType()
Get the decision node type |
abstract java.lang.String |
getDecisionPath(int daughterIndex)
Get the path leading to the daughter with the given index. |
FeatureDefinition |
getFeatureDefinition()
|
int |
getFeatureIndex()
|
java.lang.String |
getFeatureName()
Get the name of the feature |
abstract Node |
getNextNode(FeatureVector featureVector)
Select a daughter node according to the value in the given target |
abstract java.lang.String |
getNodeDefinition()
Gets the String that defines the decision done in the node |
int |
getNumberOfData()
Count all the data available at and below this node. |
int |
getNumberOfDaugthers()
Number of daughters of current node. |
int |
getNumberOfNodes()
Count all the nodes at and below this node. |
int |
getUniqueDecisionNodeId()
|
boolean |
hasMoreDaughters(int index)
Tests, if the given index refers to a daughter |
boolean |
isDecisionNode()
|
void |
replaceDaughter(Node newDaughter,
int index)
Replace daughter at given index with another daughter |
void |
setUniqueDecisionNodeId(int id)
|
java.lang.String |
toString()
|
| Methods inherited from class marytts.cart.Node |
|---|
getDecisionPath, getMother, getNodeIndex, getRootNode, isDirectedGraphNode, isLeafNode, isRoot, setIsRoot, setMother, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean TRACE
protected FeatureDefinition featureDefinition
protected Node[] daughters
protected int featureIndex
protected java.lang.String feature
protected int lastDaughter
protected int nData
protected int uniqueDecisionNodeId
| Constructor Detail |
|---|
public DecisionNode(java.lang.String feature,
int numDaughters,
FeatureDefinition featureDefinition)
feature - the featurenumDaughters - the number of daughters
public DecisionNode(int featureIndex,
int numDaughters,
FeatureDefinition featureDefinition)
featureIndex - the feature indexnumDaughters - the number of daughters
public DecisionNode(int numDaughters,
FeatureDefinition featureDefinition)
numDaughters - the number of daughters| Method Detail |
|---|
public boolean isDecisionNode()
isDecisionNode in class Nodepublic java.lang.String getFeatureName()
public int getFeatureIndex()
public FeatureDefinition getFeatureDefinition()
public void addDaughter(Node daughter)
daughter - the new daughterpublic Node getDaughter(int index)
index - the index of the daughter
public void replaceDaughter(Node newDaughter,
int index)
newDaughter - the new daughterindex - the index of the daughter to replacepublic boolean hasMoreDaughters(int index)
index - the index
public java.lang.Object getAllData()
getAllData in class Node
protected void fillData(java.lang.Object target,
int pos,
int total)
Node
fillData in class Nodepos - the position in the target at which to start writingtotal - the amount of data items to write, usually equals
getNumberOfData().public int getNumberOfNodes()
getNumberOfNodes in class Nodepublic int getNumberOfData()
Node
getNumberOfData in class Nodepublic int getNumberOfDaugthers()
public void countData()
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract java.lang.String getDecisionPath(int daughterIndex)
daughterIndex -
public void setUniqueDecisionNodeId(int id)
public int getUniqueDecisionNodeId()
public abstract java.lang.String getNodeDefinition()
public abstract DecisionNode.Type getDecisionNodeType()
public abstract Node getNextNode(FeatureVector featureVector)
target - the target
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||