LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::crispDecisionTree::crispNode Class Reference

A crisp decision tree node. More...

#include <ltiCrispDecisionTree.h>

Inheritance diagram for lti::crispDecisionTree::crispNode:
Inheritance graph
[legend]
Collaboration diagram for lti::crispDecisionTree::crispNode:
Collaboration graph
[legend]

List of all members.

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
crispNodecopy (const crispNode &other)
crispNodeoperator= (const crispNode &other)
virtual decisionTree::dtNodeclone () const
void setDecisionFunction (const crispDecisionFunction *cdf)
const crispDecisionFunctiongetDecisionFunction (const crispDecisionFunction *cdf)
const crispNodepropagate (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

crispDecisionFunctiondecisionF

Static Protected Attributes

static const objectFactory
< crispDecisionFunction
crispDecisionFunctionFactory
static const
crispDecisionFunction
cdfArray []

Detailed Description

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.


Constructor & Destructor Documentation

lti::crispDecisionTree::crispNode::crispNode (  ) 

default constructor

lti::crispDecisionTree::crispNode::crispNode ( const int &  theId  ) 

Constructor.

Sets the nodes id.

Parameters:
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.

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.

Parameters:
w the weighting vector for the data.
thresh the threshold.
theId the nodes id
lti::crispDecisionTree::crispNode::crispNode ( const crispNode other  ) 

copy constructor

Parameters:
other the crispNode object to be copied
lti::crispDecisionTree::crispNode::~crispNode (  ) 

destructor


Member Function Documentation

virtual decisionTree::dtNode* lti::crispDecisionTree::crispNode::clone (  )  const [virtual]

returns a pointer to a clone of the crispNode

Reimplemented from lti::decisionTree::dtNode.

crispNode& lti::crispDecisionTree::crispNode::copy ( const crispNode other  ) 

copy the contents of a crispNode object

Parameters:
other the crispNode object to be copied
Returns:
a reference to this crispNode object

Reimplemented from lti::decisionTree::dtNode.

const crispDecisionFunction* lti::crispDecisionTree::crispNode::getDecisionFunction ( const crispDecisionFunction cdf  ) 

Gets the crispDecisionFunction this node uses.

Returns:
const pointer to the crispDecisionFunction
const char* lti::crispDecisionTree::crispNode::getTypeName (  )  const [virtual]

returns name of this type

Reimplemented from lti::decisionTree::dtNode.

crispNode& lti::crispDecisionTree::crispNode::operator= ( const crispNode other  ) 

copy the contents of a crispNode object

Parameters:
other the crispNode object to be copied
Returns:
a reference to this crispNode object

Reimplemented from lti::decisionTree::dtNode.

const crispNode* lti::crispDecisionTree::crispNode::propagate ( const dvector data  )  const

Propagates the given value through the node.

If the crispDecisionFunction is true for this value, the left child node is returned, else the right.

Parameters:
data value to be propagated
Returns:
left or right child node
virtual bool lti::crispDecisionTree::crispNode::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

read the crispNode from the given ioHandler

Parameters:
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.
Returns:
true if write was successful

Reimplemented from lti::decisionTree::dtNode.

void lti::crispDecisionTree::crispNode::setDecisionFunction ( const crispDecisionFunction cdf  ) 

Sets the crispDecisionFunction for this node.

Parameters:
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

Parameters:
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.
Returns:
true if write was successful

Reimplemented from lti::decisionTree::dtNode.


Member Data Documentation

The array of all crispDecisionFunctions.

The objectFactory for all crispDecisionFunctions.

The crispDecisionFunction used for this node.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:26:48 2010 for LTI-Lib by Doxygen 1.6.1