Definition at line 37 of file Node.h.
Defines a map between a string (which will contain the name of the node, such as DecisionTreeNode) and a function returns a new instance of that node.
Definition at line 197 of file Node.h.
Default Constructor. Sets all the pointers to NULL.
Definition at line 42 of file Node.cpp.
Default Destructor. Cleans up any memory.
Definition at line 55 of file Node.cpp.
bool GRT::Node::clear |
( |
| ) |
|
|
virtual |
Node * GRT::Node::createInstanceFromString |
( |
string const & |
nodeType | ) |
|
|
static |
Creates a new classifier instance based on the input string (which should contain the name of a valid classifier such as ANBC).
- Parameters
-
string | const &classifierType: the name of the classifier |
- Returns
- Classifier*: a pointer to the new instance of the classifier
Definition at line 28 of file Node.cpp.
Node * GRT::Node::createNewInstance |
( |
| ) |
const |
Creates a new classifier instance based on the current classifierType string value.
- Returns
- Classifier*: a pointer to the new instance of the classifier
Definition at line 38 of file Node.cpp.
Node * GRT::Node::deepCopyNode |
( |
| ) |
const |
|
virtual |
UINT GRT::Node::getDepth |
( |
| ) |
const |
This function returns the depth of the node. The depth is the level in the tree at which the node is located, the root node has a depth of 0.
- Returns
- returns the depth of the node in the tree
Definition at line 299 of file Node.cpp.
bool GRT::Node::getHasLeftChild |
( |
| ) |
const |
This function returns true if this node has a leftChild, false otherwise.
- Returns
- returns true if this node has a leftChild, false otherwise
Definition at line 342 of file Node.cpp.
bool GRT::Node::getHasParent |
( |
| ) |
const |
This function returns true if this node has a parent, false otherwise.
- Returns
- returns true if this node has a parent, false otherwise
Definition at line 338 of file Node.cpp.
bool GRT::Node::getHasRightChild |
( |
| ) |
const |
This function returns true if this node has a rightChild, false otherwise.
- Returns
- returns true if this node has a rightChild, false otherwise
Definition at line 346 of file Node.cpp.
bool GRT::Node::getIsLeafNode |
( |
| ) |
const |
This function returns true if this node is a leaf node, false otherwise.
- Returns
- returns true if this node is a leaf node, false otherwise
Definition at line 334 of file Node.cpp.
bool GRT::Node::getModel |
( |
ostream & |
stream | ) |
const |
|
virtual |
UINT GRT::Node::getNodeID |
( |
| ) |
const |
This function returns the nodeID, this is a unique ID that represents this node within a Tree.
- Returns
- returns the nodeID of this node
Definition at line 303 of file Node.cpp.
string GRT::Node::getNodeType |
( |
| ) |
const |
This function returns the node type, this is the type of node defined by the class that inherits from the Node base class.
- Returns
- returns the nodeType
Definition at line 295 of file Node.cpp.
UINT GRT::Node::getPredictedNodeID |
( |
| ) |
const |
This function returns the predictedNodeID, this is ID of the leaf node that was reached during the last prediction call
- Returns
- returns the predictedNodeID
Definition at line 307 of file Node.cpp.
bool GRT::Node::loadFromFile |
( |
fstream & |
file | ) |
|
|
virtual |
This loads the Node from a file.
- Parameters
-
fstream | &file: a reference to the file the Node model will be loaded from |
- Returns
- returns true if the model was loaded successfully, false otherwise
Definition at line 173 of file Node.cpp.
virtual bool GRT::Node::loadParametersFromFile |
( |
fstream & |
file | ) |
|
|
inlineprotectedvirtual |
bool GRT::Node::predict |
( |
const VectorDouble & |
x | ) |
|
|
virtual |
bool GRT::Node::predict |
( |
const VectorDouble & |
x, |
|
|
VectorDouble & |
y |
|
) |
| |
|
virtual |
This function recursively predicts if the probability of the input vector. This function should be overwritten by the inheriting class.
- Parameters
-
const | VectorDouble &x: the input vector that will be used for the prediction |
VectorDouble | &y: a reference to a vector that will store the results |
- Returns
- returns true if the input is greater than or equal to the nodes threshold, false otherwise
Reimplemented in GRT::RegressionTreeNode, GRT::ClusterTreeNode, and GRT::DecisionTreeNode.
Definition at line 64 of file Node.cpp.
bool GRT::Node::print |
( |
| ) |
const |
|
virtual |
virtual bool GRT::Node::saveParametersToFile |
( |
fstream & |
file | ) |
const |
|
inlineprotectedvirtual |
bool GRT::Node::saveToFile |
( |
fstream & |
file | ) |
const |
|
virtual |
This saves the Node to a file.
- Parameters
-
fstream | &file: a reference to the file the Node model will be saved to |
- Returns
- returns true if the model was saved successfully, false otherwise
Definition at line 131 of file Node.cpp.
The documentation for this class was generated from the following files:
- /Users/ngillian/Documents/dev/libs/grt/GRT/CoreAlgorithms/Tree/Node.h
- /Users/ngillian/Documents/dev/libs/grt/GRT/CoreAlgorithms/Tree/Node.cpp