|
||||||||||
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. |
DataCell |
classifyPattern(DataRow row,
DataTableSpec spec)
Classify a new pattern given as a row of values. |
LinkedHashMap<DataCell,Double> |
getClassCounts(DataRow row,
DataTableSpec spec)
Determine class counts for a new pattern given as a row of values. |
String |
getClassifyColumn()
|
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()
|
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 |
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 foundpublic 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 valuespublic DecisionTree(DecisionTreeNode rootNode, String classifyColumn)
rootNode
- the node to attach everything toclassifyColumn
- name of attribute to classify with this treepublic DecisionTree(ModelContentRO pConf) throws InvalidSettingsException
pConf
- configuration object to load decision tree from
InvalidSettingsException
- if something goes wrongMethod Detail |
---|
public DecisionTreeNode getRootNode()
public final DataCell classifyPattern(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 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 void resetColorInformation()
public void saveToPredictorParams(ModelContentWO pConf, boolean saveKeysAndPatterns)
pConf
- configuration object to attach decision tree tosaveKeysAndPatterns
- whether to save the keys and patternspublic 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |