latest version v1.9 - last update 10 Apr 2010 |
This class serves the manual construction of a crisp decision tree with crispNodes that have univariate decision functions. More...
#include <ltiManualCrispDecisionTree.h>
Classes | |
class | parameters |
the parameters for the class manualCrispDecisionTree More... | |
Public Member Functions | |
manualCrispDecisionTree () | |
manualCrispDecisionTree (const manualCrispDecisionTree &other) | |
virtual | ~manualCrispDecisionTree () |
virtual const char * | getTypeName () const |
manualCrispDecisionTree & | copy (const manualCrispDecisionTree &other) |
manualCrispDecisionTree & | operator= (const manualCrispDecisionTree &other) |
virtual classifier * | clone () const |
const parameters & | getParameters () const |
virtual bool | train (const dmatrix &input, const ivector &ids) |
This class serves the manual construction of a crisp decision tree with crispNodes that have univariate decision functions.
Instead of training data, the train method is given the nodes' conditions and ids in pre-order. Only one element of each row vector can be unequal to zero. This dimension and the value are taken for the dimension and threshold of the condition. Thus, only univariate decisions can be used. The following example shows the data and id values of the train method and the corresponding tree:
* +- -+ +- -+ * | 0 0 2 | | -1 | * | 1 0 0 | | -1 | * | 0 2 0 | | -1 | * | 0 1 0 | | -1 | * | 0 0 0 | | 2 | * data = | 0 0 1 | ids = | -1 | * | 0 0 0 | | 5 | * | 0 0 0 | | 0 | * | 0 0 0 | | 1 | * | 0 0 0 | | 3 | * | 0 0 0 | | 4 | * +- -+ +- -+ *
The outputTemplate object of the tree will be initialized with the ids given in the ids vector. If other or multiple ids are desired, the outputTemplate object must be set manually.
lti::manualCrispDecisionTree::manualCrispDecisionTree | ( | ) |
default constructor
lti::manualCrispDecisionTree::manualCrispDecisionTree | ( | const manualCrispDecisionTree & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::manualCrispDecisionTree::~manualCrispDecisionTree | ( | ) | [virtual] |
destructor
virtual classifier* lti::manualCrispDecisionTree::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this classifier.
Implements lti::classifier.
manualCrispDecisionTree& lti::manualCrispDecisionTree::copy | ( | const manualCrispDecisionTree & | other | ) |
copy data of "other" classifier.
other | the classifier to be copied |
Reimplemented from lti::crispDecisionTree.
const parameters& lti::manualCrispDecisionTree::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::crispDecisionTree.
virtual const char* lti::manualCrispDecisionTree::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("manualCrispDecisionTree")
Reimplemented from lti::crispDecisionTree.
manualCrispDecisionTree& lti::manualCrispDecisionTree::operator= | ( | const manualCrispDecisionTree & | other | ) |
alias for copy member
other | the classifier to be copied |
Reimplemented from lti::crispDecisionTree.
virtual bool lti::manualCrispDecisionTree::train | ( | const dmatrix & | input, | |
const ivector & | ids | |||
) | [virtual] |
See description of this class.
input | the conditions of the nodes | |
ids | the ids of the nodes. |
Implements lti::supervisedInstanceClassifier.