#include <decisiontree.hh>
Public Member Functions | |
| DecisionTree (const DecisionTree &tree) | |
| @ brief copy constructor | |
| DecisionTree (unsigned int classe) | |
| Constructor. | |
| DecisionTree::DecisionTree (const DecisionTree *father, unsigned int classe) | |
| Constructor. | |
| void | clear () |
| remove and delete all node and subnode | |
| DecisionTree * | add_condition (Condition &cond) |
| create a new sub-tree for this condition and return it | |
| void | cut () |
| remove all sub node (remove all content of _sons) | |
| unsigned int | get_best_class (std::vector< Data::Column * > &data, std::vector< unsigned int > &inds) const |
| get best class (class that match the more inds possible in this tree) | |
| unsigned int | get_nb_condition () const |
| return number of condition in this node | |
| void | set_class (unsigned int classe) |
| set classification result for this node | |
| bool | match (std::vector< Data::Column * > &data, unsigned int ind) const |
| return true when a individual match with fathers of current node | |
| unsigned int | get_class (std::vector< Data::Column * > &data, unsigned int ind) const |
| get class result of an individual | |
| unsigned int | get_nb_nodes () const |
| return the number of node in the tree | |
| void | remove_son (Condition &cond) |
| remove a sub-tree by its condition | |
| void | add_node (DecisionTree &node, Condition &cond) |
| add s sub-tree | |
| void | print (std::ostream &stream, unsigned int offset) const |
| print decision tree | |
| DecisionTree * | copy () const |
| return a copy of this tree (realoc all subtree and condition) | |
|
const std::vector< std::pair< DecisionTree *, Condition * > > | get_sons () const |
Protected Member Functions | |
| bool | _submatch (const DecisionTree *son, std::vector< Data::Column * > &data, unsigned int ind) const |
| DecisionTree * | _copy (const DecisionTree *father) const |
| copy this tree and change _father value with father | |
|
std::vector< std::pair< unsigned int, unsigned int > > | _get_best_class (std::vector< Data::Column * > &data, std::vector< unsigned int > &inds) const |
| sub routine to find the class the the maximum number of individual (called by get_best_class) | |
Protected Attributes | |
| const DecisionTree * | _father |
| unsigned int | _class |
| const DecisionTree * | _myaddr |
|
std::vector< std::pair< DecisionTree *, Condition * > > | _sons |
Definition at line 42 of file decisiontree.hh.
|
|
Constructor.
Definition at line 46 of file decisiontree.cc. |
|
||||||||||||
|
Constructor.
|
|
||||||||||||
|
get class result of an individual
Definition at line 202 of file decisiontree.cc. Referenced by Algo::TreeBasedAlgo::_compute_error(). |
|
||||||||||||
|
return true when a individual match with fathers of current node
Definition at line 193 of file decisiontree.cc. References _submatch(). Referenced by Algo::C45::_c45_construct_tree(), Algo::TreeBasedAlgo::_compute_error(), Algo::TreeBasedAlgo::_compute_n(), Algo::TreeBasedAlgo::_entropie(), _get_best_class(), Algo::ID3::_get_classe(), Algo::C45::_get_classe(), Algo::TreeBasedAlgo::_get_classes(), Algo::TreeBasedAlgo::_gini(), Algo::ID3::_id3_construct_tree(), Algo::TreeBasedAlgo::_sub_construct_tree(), Data::ColumnTyped< Type >::is_finish(), and Data::ColumnTyped< Type >::is_finished(). |
1.3.2