OpenCV  2.4.13.4
Open Source Computer Vision
CvDTree Class Reference

#include <ml.hpp>

Inheritance diagram for CvDTree:
CvStatModel CvBoostTree CvForestTree CvForestERTree

Public Member Functions

 CvDTree ()
 
virtual ~CvDTree ()
 
virtual bool train (const CvMat *trainData, int tflag, const CvMat *responses, const CvMat *varIdx=0, const CvMat *sampleIdx=0, const CvMat *varType=0, const CvMat *missingDataMask=0, CvDTreeParams params=CvDTreeParams())
 
virtual bool train (CvMLData *trainData, CvDTreeParams params=CvDTreeParams())
 
virtual float calc_error (CvMLData *trainData, int type, std::vector< float > *resp=0)
 
virtual bool train (CvDTreeTrainData *trainData, const CvMat *subsampleIdx)
 
virtual CvDTreeNodepredict (const CvMat *sample, const CvMat *missingDataMask=0, bool preprocessedInput=false) const
 
virtual bool train (const cv::Mat &trainData, int tflag, const cv::Mat &responses, const cv::Mat &varIdx=cv::Mat(), const cv::Mat &sampleIdx=cv::Mat(), const cv::Mat &varType=cv::Mat(), const cv::Mat &missingDataMask=cv::Mat(), CvDTreeParams params=CvDTreeParams())
 
virtual CvDTreeNodepredict (const cv::Mat &sample, const cv::Mat &missingDataMask=cv::Mat(), bool preprocessedInput=false) const
 
virtual cv::Mat getVarImportance ()
 
virtual const CvMatget_var_importance ()
 
virtual void clear ()
 
virtual void read (CvFileStorage *fs, CvFileNode *node)
 
virtual void write (CvFileStorage *fs, const char *name) const
 
virtual void read (CvFileStorage *fs, CvFileNode *node, CvDTreeTrainData *data)
 
virtual void write (CvFileStorage *fs) const
 
const CvDTreeNodeget_root () const
 
int get_pruned_tree_idx () const
 
CvDTreeTrainDataget_data ()
 
- Public Member Functions inherited from CvStatModel
 CvStatModel ()
 
virtual ~CvStatModel ()
 
virtual void save (const char *filename, const char *name=0) const
 
virtual void load (const char *filename, const char *name=0)
 

Public Attributes

int pruned_tree_idx
 

Protected Member Functions

virtual bool do_train (const CvMat *_subsample_idx)
 
virtual void try_split_node (CvDTreeNode *n)
 
virtual void split_node_data (CvDTreeNode *n)
 
virtual CvDTreeSplitfind_best_split (CvDTreeNode *n)
 
virtual CvDTreeSplitfind_split_ord_class (CvDTreeNode *n, int vi, float init_quality=0, CvDTreeSplit *_split=0, uchar *ext_buf=0)
 
virtual CvDTreeSplitfind_split_cat_class (CvDTreeNode *n, int vi, float init_quality=0, CvDTreeSplit *_split=0, uchar *ext_buf=0)
 
virtual CvDTreeSplitfind_split_ord_reg (CvDTreeNode *n, int vi, float init_quality=0, CvDTreeSplit *_split=0, uchar *ext_buf=0)
 
virtual CvDTreeSplitfind_split_cat_reg (CvDTreeNode *n, int vi, float init_quality=0, CvDTreeSplit *_split=0, uchar *ext_buf=0)
 
virtual CvDTreeSplitfind_surrogate_split_ord (CvDTreeNode *n, int vi, uchar *ext_buf=0)
 
virtual CvDTreeSplitfind_surrogate_split_cat (CvDTreeNode *n, int vi, uchar *ext_buf=0)
 
virtual double calc_node_dir (CvDTreeNode *node)
 
virtual void complete_node_dir (CvDTreeNode *node)
 
virtual void cluster_categories (const int *vectors, int vector_count, int var_count, int *sums, int k, int *cluster_labels)
 
virtual void calc_node_value (CvDTreeNode *node)
 
virtual void prune_cv ()
 
virtual double update_tree_rnc (int T, int fold)
 
virtual int cut_tree (int T, int fold, double min_alpha)
 
virtual void free_prune_data (bool cut_tree)
 
virtual void free_tree ()
 
virtual void write_node (CvFileStorage *fs, CvDTreeNode *node) const
 
virtual void write_split (CvFileStorage *fs, CvDTreeSplit *split) const
 
virtual CvDTreeNoderead_node (CvFileStorage *fs, CvFileNode *node, CvDTreeNode *parent)
 
virtual CvDTreeSplitread_split (CvFileStorage *fs, CvFileNode *node)
 
virtual void write_tree_nodes (CvFileStorage *fs) const
 
virtual void read_tree_nodes (CvFileStorage *fs, CvFileNode *node)
 

Protected Attributes

CvDTreeNoderoot
 
CvMatvar_importance
 
CvDTreeTrainDatadata
 
- Protected Attributes inherited from CvStatModel
const char * default_model_name
 

Friends

struct cv::DTreeBestSplitFinder
 

Constructor & Destructor Documentation

§ CvDTree()

CvDTree::CvDTree ( )

§ ~CvDTree()

virtual CvDTree::~CvDTree ( )
virtual

Member Function Documentation

§ calc_error()

virtual float CvDTree::calc_error ( CvMLData trainData,
int  type,
std::vector< float > *  resp = 0 
)
virtual

§ calc_node_dir()

virtual double CvDTree::calc_node_dir ( CvDTreeNode node)
protectedvirtual

Reimplemented in CvBoostTree, and CvForestERTree.

§ calc_node_value()

virtual void CvDTree::calc_node_value ( CvDTreeNode node)
protectedvirtual

Reimplemented in CvBoostTree.

§ clear()

virtual void CvDTree::clear ( )
virtual

Reimplemented from CvStatModel.

Reimplemented in CvBoostTree.

§ cluster_categories()

virtual void CvDTree::cluster_categories ( const int vectors,
int  vector_count,
int  var_count,
int sums,
int  k,
int cluster_labels 
)
protectedvirtual

§ complete_node_dir()

virtual void CvDTree::complete_node_dir ( CvDTreeNode node)
protectedvirtual

§ cut_tree()

virtual int CvDTree::cut_tree ( int  T,
int  fold,
double  min_alpha 
)
protectedvirtual

§ do_train()

virtual bool CvDTree::do_train ( const CvMat _subsample_idx)
protectedvirtual

§ find_best_split()

virtual CvDTreeSplit* CvDTree::find_best_split ( CvDTreeNode n)
protectedvirtual

Reimplemented in CvForestTree.

§ find_split_cat_class()

virtual CvDTreeSplit* CvDTree::find_split_cat_class ( CvDTreeNode n,
int  vi,
float  init_quality = 0,
CvDTreeSplit _split = 0,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree, and CvForestERTree.

§ find_split_cat_reg()

virtual CvDTreeSplit* CvDTree::find_split_cat_reg ( CvDTreeNode n,
int  vi,
float  init_quality = 0,
CvDTreeSplit _split = 0,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree, and CvForestERTree.

§ find_split_ord_class()

virtual CvDTreeSplit* CvDTree::find_split_ord_class ( CvDTreeNode n,
int  vi,
float  init_quality = 0,
CvDTreeSplit _split = 0,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree, and CvForestERTree.

§ find_split_ord_reg()

virtual CvDTreeSplit* CvDTree::find_split_ord_reg ( CvDTreeNode n,
int  vi,
float  init_quality = 0,
CvDTreeSplit _split = 0,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree, and CvForestERTree.

§ find_surrogate_split_cat()

virtual CvDTreeSplit* CvDTree::find_surrogate_split_cat ( CvDTreeNode n,
int  vi,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree.

§ find_surrogate_split_ord()

virtual CvDTreeSplit* CvDTree::find_surrogate_split_ord ( CvDTreeNode n,
int  vi,
uchar ext_buf = 0 
)
protectedvirtual

Reimplemented in CvBoostTree.

§ free_prune_data()

virtual void CvDTree::free_prune_data ( bool  cut_tree)
protectedvirtual

§ free_tree()

virtual void CvDTree::free_tree ( )
protectedvirtual

§ get_data()

CvDTreeTrainData* CvDTree::get_data ( )

§ get_pruned_tree_idx()

int CvDTree::get_pruned_tree_idx ( ) const

§ get_root()

const CvDTreeNode* CvDTree::get_root ( ) const

§ get_var_importance()

virtual const CvMat* CvDTree::get_var_importance ( )
virtual

§ getVarImportance()

virtual cv::Mat CvDTree::getVarImportance ( )
virtual

§ predict() [1/2]

virtual CvDTreeNode* CvDTree::predict ( const CvMat sample,
const CvMat missingDataMask = 0,
bool  preprocessedInput = false 
) const
virtual

§ predict() [2/2]

virtual CvDTreeNode* CvDTree::predict ( const cv::Mat sample,
const cv::Mat missingDataMask = cv::Mat(),
bool  preprocessedInput = false 
) const
virtual

§ prune_cv()

virtual void CvDTree::prune_cv ( )
protectedvirtual

§ read() [1/2]

virtual void CvDTree::read ( CvFileStorage fs,
CvFileNode node 
)
virtual

Reimplemented from CvStatModel.

Reimplemented in CvBoostTree, and CvForestTree.

§ read() [2/2]

virtual void CvDTree::read ( CvFileStorage fs,
CvFileNode node,
CvDTreeTrainData data 
)
virtual

Reimplemented in CvBoostTree, and CvForestTree.

§ read_node()

virtual CvDTreeNode* CvDTree::read_node ( CvFileStorage fs,
CvFileNode node,
CvDTreeNode parent 
)
protectedvirtual

§ read_split()

virtual CvDTreeSplit* CvDTree::read_split ( CvFileStorage fs,
CvFileNode node 
)
protectedvirtual

§ read_tree_nodes()

virtual void CvDTree::read_tree_nodes ( CvFileStorage fs,
CvFileNode node 
)
protectedvirtual

§ split_node_data()

virtual void CvDTree::split_node_data ( CvDTreeNode n)
protectedvirtual

Reimplemented in CvForestERTree.

§ train() [1/4]

virtual bool CvDTree::train ( const CvMat trainData,
int  tflag,
const CvMat responses,
const CvMat varIdx = 0,
const CvMat sampleIdx = 0,
const CvMat varType = 0,
const CvMat missingDataMask = 0,
CvDTreeParams  params = CvDTreeParams() 
)
virtual

Reimplemented in CvBoostTree, and CvForestTree.

§ train() [2/4]

virtual bool CvDTree::train ( CvMLData trainData,
CvDTreeParams  params = CvDTreeParams() 
)
virtual

§ train() [3/4]

virtual bool CvDTree::train ( CvDTreeTrainData trainData,
const CvMat subsampleIdx 
)
virtual

Reimplemented in CvBoostTree, and CvForestTree.

§ train() [4/4]

virtual bool CvDTree::train ( const cv::Mat trainData,
int  tflag,
const cv::Mat responses,
const cv::Mat varIdx = cv::Mat(),
const cv::Mat sampleIdx = cv::Mat(),
const cv::Mat varType = cv::Mat(),
const cv::Mat missingDataMask = cv::Mat(),
CvDTreeParams  params = CvDTreeParams() 
)
virtual

§ try_split_node()

virtual void CvDTree::try_split_node ( CvDTreeNode n)
protectedvirtual

Reimplemented in CvBoostTree.

§ update_tree_rnc()

virtual double CvDTree::update_tree_rnc ( int  T,
int  fold 
)
protectedvirtual

§ write() [1/2]

virtual void CvDTree::write ( CvFileStorage fs,
const char *  name 
) const
virtual

Reimplemented from CvStatModel.

§ write() [2/2]

virtual void CvDTree::write ( CvFileStorage fs) const
virtual

§ write_node()

virtual void CvDTree::write_node ( CvFileStorage fs,
CvDTreeNode node 
) const
protectedvirtual

§ write_split()

virtual void CvDTree::write_split ( CvFileStorage fs,
CvDTreeSplit split 
) const
protectedvirtual

§ write_tree_nodes()

virtual void CvDTree::write_tree_nodes ( CvFileStorage fs) const
protectedvirtual

Friends And Related Function Documentation

§ cv::DTreeBestSplitFinder

friend struct cv::DTreeBestSplitFinder
friend

Member Data Documentation

§ data

CvDTreeTrainData* CvDTree::data
protected

§ pruned_tree_idx

int CvDTree::pruned_tree_idx

§ root

CvDTreeNode* CvDTree::root
protected

§ var_importance

CvMat* CvDTree::var_importance
protected

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