Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter > Class Template Reference

Class used in building regression trees. More...

#include <regressiontreenode.h>

Collaboration diagram for CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >:

Collaboration graph
[legend]

Public Member Functions

 BinaryRegressionTreeNode (int NodeId, int CsDim, T_Regressor &regressor, T_Distribution *ParentDistribution=0)
 Constructor for a leaf.

 BinaryRegressionTreeNode (int NodeId, const Vector< int > &DDomainSize, int CsplitDim, int RegDim, T_Regressor &regressor, T_Distribution *ParentDistribution=0)
 Constructor for an intermediate node.

 ~BinaryRegressionTreeNode (void)
int GetNodeId (void)
void ComputeSizesTree (int &nodes, int &term_nodes)
void StartLearningEpoch (void)
void LearnSample (const int *Dvars, const double *Cvars, double probability, double threshold=.01)
bool StopLearningEpoch (int splitType, int emRestarts, int emMaxIterations, double convergenceLim, int min_no_datapoints)
 Returns true if more learning has to be donne in future.

double Infer (const int *Dvars, const double *Cvars, int maxNodeId, double threshold)
 Does the inference.

void InitializePruningStatistics (void)
void UpdatePruningStatistics (const int *Dvars, const double *Cvars, double y, double probability, double threshold)
void FinalizePruningStatistics (void)
double PruneSubtree (void)
 Returns the optimal cost for this subtree and cuts the subtree to optimal size.

void SaveToStream (ostream &out)

Protected Types

enum  state { stable, em, split, regression }
 the state of the node. At creation em. At load stable More...


Protected Member Functions

void RandomDistributions (void)
double EMStep (double &Likelihood)
 Peform an EM step on the data in buff and return the convergence factor and compute the likelihood.


Protected Attributes

int nodeId
 unique identifier of the cluster for a regression tree.

int emTrials
 how many times EM was attempted

int csDim
 the number of continuous split variables

int regDim
 the number of regressors

enum CLUS::BinaryRegressionTreeNode::state State
 the state of the node. At creation em. At load stable

BinaryRegressionTreeNode<
T_Distribution, T_Regressor,
T_Splitter > * 
Children [2]
 the children of this node

T_Splitter Splitter
 splitter for split criterion

T_Regressor Regressor
 regressor for the node

T_Distribution * Distributions [2]
 distributions for the children for the learning process

T_Distribution * parentDistribution
 the distribution of the parent. Usefull in the learning process to pick initial values for the new distributions

DynamicBufferbuffer
 keep the EM samples here temporarily

double pruningCost
 sum of squared differences between prediction and true value

int pruningSamples
 number of samples in this node for pruning


Detailed Description

template<class T_Distribution, class T_Regressor, class T_Splitter>
class CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >

Class used in building regression trees.

Every class is a node in the tree, there can be 0 or 2 children NodeId determines the position of the node in the tree. The nodeId od children is alwais 2*nodeId and 2*nodeId+1. The nodeId starts from 1 for the root.

T_Distribution is the distribution that approximates the data T_Regressor is the regressor that commes with T_Distribution T_Spliter is the class that in a final scan can compute the splitting predicate

Definition at line 60 of file regressiontreenode.h.


Member Enumeration Documentation

template<class T_Distribution, class T_Regressor, class T_Splitter>
enum CLUS::BinaryRegressionTreeNode::state [protected]
 

the state of the node. At creation em. At load stable

Enumeration values:
stable 
em 
split 
regression 

Definition at line 77 of file regressiontreenode.h.


Constructor & Destructor Documentation

template<class T_Distribution, class T_Regressor, class T_Splitter>
CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode int  NodeId,
int  CsDim,
T_Regressor &  regressor,
T_Distribution *  ParentDistribution = 0
[inline]
 

Constructor for a leaf.

Definition at line 149 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode int  NodeId,
const Vector< int > &  DDomainSize,
int  CsplitDim,
int  RegDim,
T_Regressor &  regressor,
T_Distribution *  ParentDistribution = 0
[inline]
 

Constructor for an intermediate node.

Definition at line 160 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::~BinaryRegressionTreeNode void   )  [inline]
 

Definition at line 178 of file regressiontreenode.h.


Member Function Documentation

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::ComputeSizesTree int &  nodes,
int &  term_nodes
[inline]
 

Definition at line 200 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
double CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::EMStep double &  Likelihood  )  [inline, protected]
 

Peform an EM step on the data in buff and return the convergence factor and compute the likelihood.

Definition at line 122 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::FinalizePruningStatistics void   )  [inline]
 

Definition at line 560 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::GetNodeId void   )  [inline]
 

Definition at line 195 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
double CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Infer const int *  Dvars,
const double *  Cvars,
int  maxNodeId,
double  threshold
[inline]
 

Does the inference.

Definition at line 504 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::InitializePruningStatistics void   )  [inline]
 

Definition at line 521 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample const int *  Dvars,
const double *  Cvars,
double  probability,
double  threshold = .01
[inline]
 

Definition at line 239 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
double CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::PruneSubtree void   )  [inline]
 

Returns the optimal cost for this subtree and cuts the subtree to optimal size.

Definition at line 566 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::RandomDistributions void   )  [inline, protected]
 

Definition at line 103 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::SaveToStream ostream &  out  )  [inline]
 

Definition at line 597 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch void   )  [inline]
 

Definition at line 214 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
bool CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch int  splitType,
int  emRestarts,
int  emMaxIterations,
double  convergenceLim,
int  min_no_datapoints
[inline]
 

Returns true if more learning has to be donne in future.

Definition at line 309 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
void CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::UpdatePruningStatistics const int *  Dvars,
const double *  Cvars,
double  y,
double  probability,
double  threshold
[inline]
 

Definition at line 533 of file regressiontreenode.h.


Field Documentation

template<class T_Distribution, class T_Regressor, class T_Splitter>
DynamicBuffer* CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::buffer [protected]
 

keep the EM samples here temporarily

Definition at line 95 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::EMStep(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >* CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Children[2] [protected]
 

the children of this node

Definition at line 80 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::ComputeSizesTree(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Infer(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::InitializePruningStatistics(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::PruneSubtree(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::SaveToStream(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::UpdatePruningStatistics(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::~BinaryRegressionTreeNode().

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::csDim [protected]
 

the number of continuous split variables

Definition at line 71 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Infer(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::UpdatePruningStatistics().

template<class T_Distribution, class T_Regressor, class T_Splitter>
T_Distribution* CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Distributions[2] [protected]
 

distributions for the children for the learning process

Definition at line 89 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::EMStep(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::RandomDistributions(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::~BinaryRegressionTreeNode().

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::emTrials [protected]
 

how many times EM was attempted

Definition at line 68 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::nodeId [protected]
 

unique identifier of the cluster for a regression tree.

the id of the children is always 2*Id, 2*Id+1

Definition at line 65 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::GetNodeId(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Infer(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::SaveToStream(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
T_Distribution* CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::parentDistribution [protected]
 

the distribution of the parent. Usefull in the learning process to pick initial values for the new distributions

Definition at line 92 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
double CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::pruningCost [protected]
 

sum of squared differences between prediction and true value

Definition at line 98 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::InitializePruningStatistics(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::PruneSubtree(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::UpdatePruningStatistics().

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::pruningSamples [protected]
 

number of samples in this node for pruning

Definition at line 101 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::InitializePruningStatistics().

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::regDim [protected]
 

the number of regressors

Definition at line 74 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::EMStep(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch().

template<class T_Distribution, class T_Regressor, class T_Splitter>
T_Regressor CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Regressor [protected]
 

regressor for the node

Definition at line 86 of file regressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
T_Splitter CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Splitter [protected]
 

splitter for split criterion

Definition at line 83 of file regressiontreenode.h.

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::Infer(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::SaveToStream(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::UpdatePruningStatistics().

template<class T_Distribution, class T_Regressor, class T_Splitter>
enum CLUS::BinaryRegressionTreeNode::state CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::State [protected]
 

the state of the node. At creation em. At load stable

Referenced by CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryRegressionTreeNode(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch(), and CLUS::BinaryRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StopLearningEpoch().


The documentation for this class was generated from the following file:
Generated on Mon Jul 21 16:57:46 2003 for SECRET by doxygen 1.3.2