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;
193 n->
SetAlpha(std::numeric_limits<double>::infinity( ));
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
MsgLogger & Endl(MsgLogger &ml)
Double_t GetNodePurityLimit() const
virtual DecisionTreeNode * GetParent() const
std::vector< DecisionTreeNode * > PruneSequence
the regularization parameter for pruning
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 GetNSigEvents(void) const
virtual DecisionTreeNode * GetRoot() const
Double_t GetSubTreeR() const
Float_t GetSeparationIndex(void) const
Float_t GetNBkgEvents(void) const
Double_t GetNodeR() 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)
void SetSubTreeR(Double_t r)
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...
void ApplyValidationSample(const EventConstList *validationSample) const
run the validation sample through the (pruned) tree and fill in the nodes the variables NSValidation ...
Double_t GetAlphaMinSubtree() const
void SetAlphaMinSubtree(Double_t g)
void SetTerminal(Bool_t s=kTRUE)
Abstract ClassifierFactory template that handles arbitrary types.
virtual Double_t GetSeparationIndex(const Double_t &s, const Double_t &b)=0
Short_t Max(Short_t a, Short_t b)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual DecisionTreeNode * GetLeft() const
virtual DecisionTreeNode * GetRight() const
Double_t GetAlpha() const
Int_t GetNTerminal() const