|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.base.node.mine.decisiontree2.model.DecisionTreeNode
org.knime.base.node.mine.decisiontree2.model.DecisionTreeNodeLeaf
public class DecisionTreeNodeLeaf
The Leaf of a decision tree. It stores class information and also some information about the patterns this leaf "coveres".
| Constructor Summary | |
|---|---|
DecisionTreeNodeLeaf()
Empty Constructor visible only within package. |
|
DecisionTreeNodeLeaf(int nodeId,
DataCell majorityClass,
LinkedHashMap<DataCell,Double> classCounts)
Constructor of base class. |
|
DecisionTreeNodeLeaf(Node xmlNode,
DataCellStringMapper mapper)
Constructor of derived class. |
|
| Method Summary | |
|---|---|
void |
addCoveredColor(DataRow row,
DataTableSpec spec,
double weight)
Add colors for a pattern given as a row of values. |
void |
addCoveredPattern(DataRow row,
DataTableSpec spec,
double weight)
Add patterns given as a row of values. |
boolean |
addNodeToTreeDepthFirst(DecisionTreeNode node,
int ix)
Add a new node to the tree structure based on a depth-first indexing strategy. |
Enumeration<DecisionTreeNode> |
children()
|
Set<RowKey> |
coveredPattern()
|
boolean |
getAllowsChildren()
|
DecisionTreeNode |
getChildAt(int pos)
|
int |
getChildCount()
|
LinkedHashMap<DataCell,Double> |
getClassCounts(DataRow row,
DataTableSpec spec)
Determine class counts for a new pattern given as a row of values. |
int |
getCountOfSubtree()
Returns the count of the subtree. |
int |
getIndex(TreeNode node)
Returns the index of node in the receivers children. |
String |
getStringSummary()
|
boolean |
isLeaf()
|
boolean |
isPureEnough()
Get the marker field for the purity. |
void |
loadNodeInternalsFromPredParams(ModelContentRO pConf)
Load internal node settings from a model content object. |
void |
saveNodeInternalsToPredParams(ModelContentWO pConf,
boolean saveKeysAndPatterns)
Save internal node settings to a model content object. |
void |
setPureEnough(boolean pureEnough)
Set the marker field for the purity. |
| Methods inherited from class org.knime.base.node.mine.decisiontree2.model.DecisionTreeNode |
|---|
addColorToMap, coveredColors, createNewNode, createNodeFromPredictorParams, getClassCounts, getCustomData, getEntireClassCount, getMajorityClass, getOverallColorCount, getOwnClassCount, getOwnIndex, getParent, getPrefix, getWinnerAndClasscounts, loadFromPredictorParams, newColors, resetColorInformation, saveToPredictorParams, setCoveredColors, setCustomData, setParent, setPrefix, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
DecisionTreeNodeLeaf()
public DecisionTreeNodeLeaf(Node xmlNode,
DataCellStringMapper mapper)
xmlNode - XML node containing infomapper - map translating column names to DataCells and vice
versa
public DecisionTreeNodeLeaf(int nodeId,
DataCell majorityClass,
LinkedHashMap<DataCell,Double> classCounts)
nodeId - the id of this nodemajorityClass - the majority class of the records in this nodeclassCounts - the class distribution of the data in this node| Method Detail |
|---|
public boolean addNodeToTreeDepthFirst(DecisionTreeNode node,
int ix)
addNodeToTreeDepthFirst in class DecisionTreeNodenode - node to be insertedix - index of this node in depth first traversal order
public LinkedHashMap<DataCell,Double> getClassCounts(DataRow row,
DataTableSpec spec)
getClassCounts in class DecisionTreeNoderow - input patternspec - the corresponding table spec
Exception - if something went wrong (unknown attriubte for example)
public final void addCoveredPattern(DataRow row,
DataTableSpec spec,
double weight)
throws Exception
addCoveredPattern in class DecisionTreeNoderow - input patternspec - the corresponding table specweight - the weight of the row (between 0.0 and 1.0)
Exception - if something went wrong (unknown attriubte for example)
public final void addCoveredColor(DataRow row,
DataTableSpec spec,
double weight)
throws Exception
addCoveredColor in class DecisionTreeNoderow - input patternspec - the corresponding table specweight - the weight of the row (between 0.0 and 1.0)
Exception - if something went wrong (unknown attriubte for example)public Set<RowKey> coveredPattern()
coveredPattern in class DecisionTreeNodepublic String getStringSummary()
getStringSummary in class DecisionTreeNode
public void saveNodeInternalsToPredParams(ModelContentWO pConf,
boolean saveKeysAndPatterns)
saveNodeInternalsToPredParams in class DecisionTreeNodepConf - configuration object to attach decision tree tosaveKeysAndPatterns - whether to save the keys and patterns
public void loadNodeInternalsFromPredParams(ModelContentRO pConf)
throws InvalidSettingsException
loadNodeInternalsFromPredParams in class DecisionTreeNodepConf - configuration object to load decision tree from
InvalidSettingsException - if something goes wrongpublic int getChildCount()
getChildCount in interface TreeNodegetChildCount in class DecisionTreeNodepublic int getIndex(TreeNode node)
getIndex in interface TreeNodegetIndex in class DecisionTreeNodenode - that supposedly is a child of this one
public DecisionTreeNode getChildAt(int pos)
getChildAt in interface TreeNodegetChildAt in class DecisionTreeNodepos - position of child
public boolean isLeaf()
isLeaf in interface TreeNodeisLeaf in class DecisionTreeNodetrue if node is a leafpublic Enumeration<DecisionTreeNode> children()
children in interface TreeNodechildren in class DecisionTreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface TreeNodegetAllowsChildren in class DecisionTreeNodetrue if the receiver allows childrenpublic int getCountOfSubtree()
getCountOfSubtree in class DecisionTreeNodepublic boolean isPureEnough()
public void setPureEnough(boolean pureEnough)
pureEnough - true if this leaf should be marked as pure enough
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||