Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members

Algo::TreeBasedAlgo Class Reference

This class represent a supervised learning algorithm wich output a decision tree. More...

#include <treebasedalgo.hh>

Inheritance diagram for Algo::TreeBasedAlgo:

Algo::C45 Algo::CART Algo::ID3 List of all members.

Public Member Functions

 TreeBasedAlgo (std::vector< Data::Column * > &cols, std::vector< unsigned int > &learning, std::string &classification_col)
virtual Tree::DecisionTreeget_result ()
const Tree::DecisionTreeget_tree () const
 return true


Protected Member Functions

unsigned int _compute_error (Tree::DecisionTree &tree) const
 compute the error : the number of element in learning set that are not correclty classified

unsigned int _compute_error (Tree::DecisionTree &tree, unsigned int classe) const
 compute the error : the number of element in learning set that are not in class ``classe''

unsigned int _compute_n (Tree::DecisionTree &tree, bool learning) const
 return the number of learning elements that match the tree

template<typename Type> void _compute_modalities (Data::ColumnTyped< Type > *col)
 compute modalities of classification result

bool _match_ind_class (unsigned int ind, unsigned int classe) const
 return true if the result classification if the same for the individual number ind and the class number classe

float _gini (Tree::DecisionTree &tree)
 compute the gini fonction for a node in the tree

float _gini (Tree::DecisionTree &tree, unsigned int column)
 compute the gini fonction for a node in the tree and for a variable

template<typename Type> float _gini (Tree::DecisionTree &tree, Data::ColumnTyped< Type > *col, unsigned int col_nb)
 compute the gini fonction for a node in the tree and for a typed variable

float _entropie (Tree::DecisionTree &tree)
 compute the entropie fonction for a node in the tree

float _entropie (Tree::DecisionTree &tree, unsigned int column)
 compute the entropie fonction for a node in the tree and for a variable

template<typename Type> float TreeBasedAlgo::_entropie (Tree::DecisionTree &tree, Data::ColumnTyped< Type > *col, unsigned int col_nb)
 compute the entropie fonction for a node in the tree and for a typed variable

template<typename Type> float _sub_construct_tree (Tree::DecisionTree &tree, Data::ColumnTyped< Type > *col, unsigned int col_nb)
 , construct the tree when column is selected

template<typename Type> std::pair< unsigned int, unsigned
int > 
_get_classes (Tree::DecisionTree &inf_tree, Tree::DecisionTree &sup_tree, Data::ColumnTyped< Type > *col)
 , return the destination class (optimized for binary tree)

virtual void _construct_tree (Tree::DecisionTree &tree)
 private methode to start construction


Protected Attributes

Tree::DecisionTree _tree
 result tree

std::vector< Data::Column * > & _cols
 columns

std::vector< unsigned int > & _learning
 learning data

std::vector< unsigned int > _test
 test data

std::vector< unsigned int > _modalities
 modalities of classification result (index in columns)

unsigned int _classification_col
 classification column


Detailed Description

This class represent a supervised learning algorithm wich output a decision tree.

Author:
Julien LEMOINE <speedblue@debian.org>

Definition at line 36 of file treebasedalgo.hh.


Constructor & Destructor Documentation

Algo::TreeBasedAlgo::TreeBasedAlgo std::vector< Data::Column * > &  cols,
std::vector< unsigned int > &  learning,
std::string &  classification_col
 

Parameters:
cols represents the datas
learning represents the learnings data
classification_col is the name of the classification result column

Definition at line 31 of file treebasedalgo.cc.

References _classification_col, _cols, _compute_modalities(), and _test.


The documentation for this class was generated from the following files:
Generated on Tue Jul 29 15:39:08 2003 for libdatamining by doxygen 1.3.2