|
||||||||||
| 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.DecisionTree
public class DecisionTree
A Wrapper for a decision tree, allowing for save/load to
ModelContent objects.
| Constructor Summary | |
|---|---|
DecisionTree(DecisionTreeNode rootNode,
String classifyColumn)
Create DecisionTree based on a root node to which the remainder of the tree is already attached. |
|
DecisionTree(DecisionTreeNode rootNode,
String classifyColumn,
PMMLMissingValueStrategy mvStrategy)
Create DecisionTree based on a root node to which the remainder of the tree is already attached. |
|
DecisionTree(DecisionTreeNode rootNode,
String classifyColumn,
PMMLMissingValueStrategy mvStrategy,
PMMLNoTrueChildStrategy ntcStrategy)
Create DecisionTree based on a root node to which the remainder of the tree is already attached. |
|
DecisionTree(ModelContentRO pConf)
Create Decision Tree based on an ModelContent object. |
|
| Method Summary | |
|---|---|
void |
addCoveredColor(DataRow row,
DataTableSpec spec)
Add color of a new pattern to this tree. |
void |
addCoveredPattern(DataRow row,
DataTableSpec spec)
Add a new pattern to this tree for HiLiting purposes. |
LinkedHashMap<DataCell,Double> |
getClassCounts(DataRow row,
DataTableSpec spec)
Determine class counts for a new pattern given as a row of values. |
String |
getClassifyColumn()
|
String |
getColorColumn()
|
DecisionTreeNodeLeaf |
getFirstLeafDFS()
Returns the first leaf according to a depth first traversal. |
PMMLMissingValueStrategy |
getMVStrategy()
|
PMMLNoTrueChildStrategy |
getNTCStrategy()
|
int |
getNumberNodes()
Returns the number decision tree nodes. |
DecisionTreeNode |
getRootNode()
|
Pair<DataCell,LinkedHashMap<DataCell,Double>> |
getWinnerAndClasscounts(DataRow row,
DataTableSpec spec)
Delegates to DecisionTreeNode.getWinnerAndClasscounts(DataRow, DataTableSpec) |
void |
loadFromPredictorParams(ModelContentRO pConf)
Load Decision Tree from a ModelContent object. |
void |
resetColorInformation()
Clean all color information in the entire tree. |
void |
saveToPredictorParams(ModelContentWO pConf,
boolean saveKeysAndPatterns)
Save decision tree to a ModelContent object. |
void |
setColorColumn(String colorColumn)
|
void |
setRoot(DecisionTreeNode root)
Sets a new root node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DecisionTree(DecisionTreeNode rootNode,
String classifyColumn,
PMMLMissingValueStrategy mvStrategy,
PMMLNoTrueChildStrategy ntcStrategy)
rootNode - the node to attach everything toclassifyColumn - name of attribute to classify with this treemvStrategy - the strategy to to apply in case of missing valuesntcStrategy - the strategy to apply when no branch is found
public DecisionTree(DecisionTreeNode rootNode,
String classifyColumn,
PMMLMissingValueStrategy mvStrategy)
rootNode - the node to attach everything toclassifyColumn - name of attribute to classify with this treemvStrategy - the strategy to to apply in case of missing values
public DecisionTree(DecisionTreeNode rootNode,
String classifyColumn)
rootNode - the node to attach everything toclassifyColumn - name of attribute to classify with this tree
public DecisionTree(ModelContentRO pConf)
throws InvalidSettingsException
pConf - configuration object to load decision tree from
InvalidSettingsException - if something goes wrong| Method Detail |
|---|
public DecisionTreeNode getRootNode()
public final void addCoveredPattern(DataRow row,
DataTableSpec spec)
throws Exception
row - input patternspec - the corresponding table spec
Exception - if something went wrong (unknown attriubte for example)
public final void addCoveredColor(DataRow row,
DataTableSpec spec)
throws Exception
row - input patternspec - the corresponding table spec
Exception - if something went wrong (unknown attriubte for example)
public LinkedHashMap<DataCell,Double> getClassCounts(DataRow row,
DataTableSpec spec)
throws Exception
row - input patternspec - the corresponding table spec
Exception - if something went wrong (unknown attriubte for example)
public final Pair<DataCell,LinkedHashMap<DataCell,Double>> getWinnerAndClasscounts(DataRow row,
DataTableSpec spec)
throws Exception
DecisionTreeNode.getWinnerAndClasscounts(DataRow, DataTableSpec)
Exceptionpublic void resetColorInformation()
public void saveToPredictorParams(ModelContentWO pConf,
boolean saveKeysAndPatterns)
pConf - configuration object to attach decision tree tosaveKeysAndPatterns - whether to save the keys and patterns
public void loadFromPredictorParams(ModelContentRO pConf)
throws InvalidSettingsException
pConf - configuration object to load decision tree from
InvalidSettingsException - if something goes wrongpublic int getNumberNodes()
public DecisionTreeNodeLeaf getFirstLeafDFS()
public void setRoot(DecisionTreeNode root)
root - the new root to setpublic String getClassifyColumn()
public PMMLMissingValueStrategy getMVStrategy()
public PMMLNoTrueChildStrategy getNTCStrategy()
public String getColorColumn()
public void setColorColumn(String colorColumn)
colorColumn - the colorColumn to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||