latest version v1.9 - last update 10 Apr 2010 |
A crisp decision tree node. More...
#include <ltiCrispDecisionTree.h>
Public Member Functions | |
crispNode () | |
crispNode (const int &theId) | |
crispNode (const int &dim, const double &thresh, const int &theId=-1) | |
crispNode (const dvector &w, const double &thresh, const int &theId=-1) | |
crispNode (const crispNode &other) | |
~crispNode () | |
const char * | getTypeName () const |
crispNode & | copy (const crispNode &other) |
crispNode & | operator= (const crispNode &other) |
virtual decisionTree::dtNode * | clone () const |
void | setDecisionFunction (const crispDecisionFunction *cdf) |
const crispDecisionFunction * | getDecisionFunction (const crispDecisionFunction *cdf) |
const crispNode * | propagate (const dvector &data) const |
virtual bool | write (ioHandler &handler, const bool complete=true) const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Protected Attributes | |
crispDecisionFunction * | decisionF |
Static Protected Attributes | |
static const objectFactory < crispDecisionFunction > | crispDecisionFunctionFactory |
static const crispDecisionFunction * | cdfArray [] |
A crisp decision tree node.
Its main difference to the dtNode is that it contains a crispDecisionFunction. The propagate method uses this function to determine which child node to return: left node if the condition is true, right node if it is false.
lti::crispDecisionTree::crispNode::crispNode | ( | ) |
default constructor
lti::crispDecisionTree::crispNode::crispNode | ( | const int & | theId | ) |
Constructor.
Sets the nodes id.
theId | the nodes id |
lti::crispDecisionTree::crispNode::crispNode | ( | const int & | dim, | |
const double & | thresh, | |||
const int & | theId = -1 | |||
) |
Conveniance Constructor.
New node with univariateCrispDecisionFunction with the given parameters.
dim | the dimension to be tested. | |
thresh | the threshold in that dimension | |
theId | the nodes id |
lti::crispDecisionTree::crispNode::crispNode | ( | const dvector & | w, | |
const double & | thresh, | |||
const int & | theId = -1 | |||
) |
Conveniance Constructor.
New node with multivariateCrispDecisionFunction with the given parameters.
w | the weighting vector for the data. | |
thresh | the threshold. | |
theId | the nodes id |
lti::crispDecisionTree::crispNode::crispNode | ( | const crispNode & | other | ) |
lti::crispDecisionTree::crispNode::~crispNode | ( | ) |
destructor
virtual decisionTree::dtNode* lti::crispDecisionTree::crispNode::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the crispNode
Reimplemented from lti::decisionTree::dtNode.
const crispDecisionFunction* lti::crispDecisionTree::crispNode::getDecisionFunction | ( | const crispDecisionFunction * | cdf | ) |
Gets the crispDecisionFunction this node uses.
const char* lti::crispDecisionTree::crispNode::getTypeName | ( | ) | const [virtual] |
returns name of this type
Reimplemented from lti::decisionTree::dtNode.
Propagates the given value through the node.
If the crispDecisionFunction is true for this value, the left child node is returned, else the right.
data | value to be propagated |
virtual bool lti::crispDecisionTree::crispNode::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
read the crispNode from the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::decisionTree::dtNode.
void lti::crispDecisionTree::crispNode::setDecisionFunction | ( | const crispDecisionFunction * | cdf | ) |
Sets the crispDecisionFunction for this node.
cdf | the new crispDecisionFunction |
virtual bool lti::crispDecisionTree::crispNode::write | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | const [virtual] |
write the crispNode in the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::decisionTree::dtNode.
const crispDecisionFunction* lti::crispDecisionTree::crispNode::cdfArray[] [static, protected] |
The array of all crispDecisionFunctions.
const objectFactory<crispDecisionFunction> lti::crispDecisionTree::crispNode::crispDecisionFunctionFactory [static, protected] |
The objectFactory for all crispDecisionFunctions.
The crispDecisionFunction used for this node.