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

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

Class used in building regression trees. More...

#include <probabilisticregressiontreenode.h>

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

Collaboration graph
[legend]

Public Member Functions

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

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

 ~BinaryProbabilisticRegressionTreeNode (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)
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)
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)
 Perform 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::BinaryProbabilisticRegressionTreeNode::state State
 the state of the node. At creation em. At load stable

BinaryProbabilisticRegressionTreeNode<
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::BinaryProbabilisticRegressionTreeNode< 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 probabilisticregressiontreenode.h.


Member Enumeration Documentation

template<class T_Distribution, class T_Regressor, class T_Splitter>
enum CLUS::BinaryProbabilisticRegressionTreeNode::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 probabilisticregressiontreenode.h.


Constructor & Destructor Documentation

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

Constructor for a leaf.

Definition at line 146 of file probabilisticregressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
CLUS::BinaryProbabilisticRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryProbabilisticRegressionTreeNode 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 157 of file probabilisticregressiontreenode.h.

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

Definition at line 175 of file probabilisticregressiontreenode.h.


Member Function Documentation

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

Definition at line 197 of file probabilisticregressiontreenode.h.

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

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

Definition at line 122 of file probabilisticregressiontreenode.h.

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

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

Definition at line 525 of file probabilisticregressiontreenode.h.

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

Definition at line 192 of file probabilisticregressiontreenode.h.

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

Does the inference.

Definition at line 482 of file probabilisticregressiontreenode.h.

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

Definition at line 499 of file probabilisticregressiontreenode.h.

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

Todo:
put some cutoff here to use less data as you go down

Definition at line 236 of file probabilisticregressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
double CLUS::BinaryProbabilisticRegressionTreeNode< 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 531 of file probabilisticregressiontreenode.h.

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

Definition at line 103 of file probabilisticregressiontreenode.h.

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

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

Definition at line 565 of file probabilisticregressiontreenode.h.

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

Definition at line 211 of file probabilisticregressiontreenode.h.

template<class T_Distribution, class T_Regressor, class T_Splitter>
bool CLUS::BinaryProbabilisticRegressionTreeNode< 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 293 of file probabilisticregressiontreenode.h.

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

Definition at line 510 of file probabilisticregressiontreenode.h.


Field Documentation

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

keep the EM samples here temporarily

Definition at line 95 of file probabilisticregressiontreenode.h.

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

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

the children of this node

Definition at line 80 of file probabilisticregressiontreenode.h.

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

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

the number of continuous split variables

Definition at line 71 of file probabilisticregressiontreenode.h.

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

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

distributions for the children for the learning process

Definition at line 89 of file probabilisticregressiontreenode.h.

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

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

how many times EM was attempted

Definition at line 68 of file probabilisticregressiontreenode.h.

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

template<class T_Distribution, class T_Regressor, class T_Splitter>
int CLUS::BinaryProbabilisticRegressionTreeNode< 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 probabilisticregressiontreenode.h.

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

template<class T_Distribution, class T_Regressor, class T_Splitter>
T_Distribution* CLUS::BinaryProbabilisticRegressionTreeNode< 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 probabilisticregressiontreenode.h.

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

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

sum of squared differences between prediction and true value

Definition at line 98 of file probabilisticregressiontreenode.h.

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

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

number of samples in this node for pruning

Definition at line 101 of file probabilisticregressiontreenode.h.

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

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

the number of regressors

Definition at line 74 of file probabilisticregressiontreenode.h.

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

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

regressor for the node

Definition at line 86 of file probabilisticregressiontreenode.h.

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

splitter for split criterion

Definition at line 83 of file probabilisticregressiontreenode.h.

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

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

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

Referenced by CLUS::BinaryProbabilisticRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::BinaryProbabilisticRegressionTreeNode(), CLUS::BinaryProbabilisticRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::LearnSample(), CLUS::BinaryProbabilisticRegressionTreeNode< T_Distribution, T_Regressor, T_Splitter >::StartLearningEpoch(), and CLUS::BinaryProbabilisticRegressionTreeNode< 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