47 fLogger(new
MsgLogger(
"CostComplexityPruneTool") )
100 Log() <<
kDEBUG <<
"Sum of weights in pruning validation sample: " << W <<
Endl;
101 Log() <<
kDEBUG <<
"Quality of tree prior to any pruning is " << Q/W <<
Endl;
108 catch(std::string error) {
109 Log() <<
kERROR <<
"Couldn't initialize the tree meta data because of error ("
110 << error <<
")" <<
Endl;
119 catch(std::string error) {
120 Log() <<
kERROR <<
"Error optimzing pruning sequence ("
121 << error <<
")" <<
Endl;
135 Log() <<
kINFO <<
"no proper pruning could be calulated. Tree "
136 << dt->
GetTreeID() <<
" will not be pruned. Do not worry if this "
137 <<
" happens for a few trees " <<
Endl;
160 if( n ==
NULL )
return;
245 Log() <<
kDEBUG <<
"\nCaught trying to prune the root node!" <<
Endl;
266 Log() <<
kDEBUG <<
"\nCaught trying to prune the root node!" <<
Endl;
331 Log() <<
kDEBUG <<
"Pruning strength parameters: [";
334 Log() <<
kDEBUG << fPruneStrengthList[fPruneStrengthList.size()-1] <<
"]" <<
Endl;
336 Log() <<
kDEBUG <<
"Misclassification rates: [";
339 Log() <<
kDEBUG << fQualityIndexList[fQualityIndexList.size()-1] <<
"]" <<
Endl;
void SetNTerminal(Int_t n)
Double_t PruneStrength
quality measure for a pruned subtree T of T_max
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
MsgLogger & Endl(MsgLogger &ml)
Double_t GetNodePurityLimit() const
Double_t GetAlpha() const
virtual DecisionTreeNode * GetRight() const
std::vector< DecisionTreeNode * > PruneSequence
the regularization parameter for pruning
virtual DecisionTreeNode * GetLeft() const
virtual DecisionTreeNode * GetParent() const
virtual DecisionTreeNode * GetRoot() const
Double_t GetSumWeights(const EventConstList *validationSample) const
calculate the normalization factor for a pruning validation sample
void SetNodeR(Double_t r)
void SetMinType(EMsgType minType)
Double_t GetSubTreeR() const
Double_t GetAlphaMinSubtree() const
Float_t GetNBkgEvents(void) const
void SetSubTreeR(Double_t r)
Int_t GetNTerminal() const
void SetAlpha(Double_t alpha)
void PruneNodeInPlace(TMVA::DecisionTreeNode *node)
prune a node temporaily (without actually deleting its decendants which allows testing the pruned tre...
Double_t GetNodeR() const
void SetAlphaMinSubtree(Double_t g)
void SetTerminal(Bool_t s=kTRUE)
virtual Double_t GetSeparationIndex(const Double_t &s, const Double_t &b)=0
Short_t Max(Short_t a, Short_t b)
Double_t TestPrunedTreeQuality(const DecisionTreeNode *dt=NULL, Int_t mode=0) const
return the misclassification rate of a pruned tree a "pruned tree" may have set the variable "IsTermi...
Float_t GetSeparationIndex(void) const
Float_t GetNSigEvents(void) const
void ApplyValidationSample(const EventConstList *validationSample) const
run the validation sample through the (pruned) tree and fill in the nodes the variables NSValidation ...