A helper class to prune a decision tree using the expected error (C4.5) method.
Uses an upper limit on the error made by the classification done by each node. If the \( \frac{S}{S+B} \) of the node is \( f \), then according to the training sample, the error rate (fraction of misclassified events by this node) is \( (1-f) \). Now \( f \) has a statistical error according to the binomial distribution hence the error on \( f \) can be estimated (same error as the binomial error for efficiency calculations \( (\sigma = \sqrt{\frac{(eff(1-eff)}{nEvts}}) \)
This tool prunes branches from a tree if the expected error of a node is less than that of the sum of the error in its descendants.
Definition at line 54 of file ExpectedErrorPruneTool.h.
Public Member Functions | |
ExpectedErrorPruneTool () | |
virtual | ~ExpectedErrorPruneTool () |
virtual PruningInfo * | CalculatePruningInfo (DecisionTree *dt, const IPruneTool::EventSample *testEvents=nullptr, Bool_t isAutomatic=kFALSE) |
void | SetPruneStrengthIncrement (Double_t dalpha) |
Public Member Functions inherited from TMVA::IPruneTool | |
IPruneTool () | |
virtual | ~IPruneTool () |
Double_t | GetPruneStrength () const |
Bool_t | IsAutomatic () const |
void | SetAutomatic () |
void | SetPruneStrength (Double_t alpha) |
Private Member Functions | |
Int_t | CountNodes (DecisionTreeNode *node, Int_t icount=0) |
void | FindListOfNodes (DecisionTreeNode *node) |
recursive pruning of nodes using the Expected Error Pruning (EEP) | |
Double_t | GetNodeError (DecisionTreeNode *node) const |
Calculate an UPPER limit on the error made by the classification done by this node. | |
Double_t | GetSubTreeError (DecisionTreeNode *node) const |
calculate the expected statistical error on the subtree below "node" which is used in the expected error pruning | |
MsgLogger & | Log () const |
Private Attributes | |
Double_t | fDeltaPruneStrength |
! the stepsize for optimizing the pruning strength parameter | |
MsgLogger * | fLogger |
message logger | |
Double_t | fNodePurityLimit |
! the purity limit for labelling a terminal node as signal | |
std::vector< DecisionTreeNode * > | fPruneSequence |
! the (optimal) prune sequence | |
Additional Inherited Members | |
Public Types inherited from TMVA::IPruneTool | |
typedef std::vector< const Event * > | EventSample |
Protected Attributes inherited from TMVA::IPruneTool | |
Double_t | B |
Double_t | fPruneStrength |
! regularization parameter in pruning | |
Double_t | S |
#include <TMVA/ExpectedErrorPruneTool.h>
TMVA::ExpectedErrorPruneTool::ExpectedErrorPruneTool | ( | ) |
Definition at line 62 of file ExpectedErrorPruneTool.cxx.
|
virtual |
Definition at line 71 of file ExpectedErrorPruneTool.cxx.
|
virtual |
Implements TMVA::IPruneTool.
Definition at line 79 of file ExpectedErrorPruneTool.cxx.
|
inlineprivate |
Definition at line 81 of file ExpectedErrorPruneTool.h.
|
private |
recursive pruning of nodes using the Expected Error Pruning (EEP)
Definition at line 175 of file ExpectedErrorPruneTool.cxx.
|
private |
Calculate an UPPER limit on the error made by the classification done by this node.
If the S/S+B of the node is f, then according to the training sample, the error rate (fraction of misclassified events by this node) is (1-f) Now f has a statistical error according to the binomial distribution hence the error on f can be estimated (same error as the binomial error for efficiency calculations \( (\sigma = \sqrt{\frac{(eff(1-eff)}{nEvts}}) \)
Definition at line 219 of file ExpectedErrorPruneTool.cxx.
|
private |
calculate the expected statistical error on the subtree below "node" which is used in the expected error pruning
Definition at line 193 of file ExpectedErrorPruneTool.cxx.
|
inlineprivate |
Definition at line 78 of file ExpectedErrorPruneTool.h.
|
inline |
Definition at line 65 of file ExpectedErrorPruneTool.h.
|
private |
! the stepsize for optimizing the pruning strength parameter
Definition at line 73 of file ExpectedErrorPruneTool.h.
|
mutableprivate |
message logger
Definition at line 77 of file ExpectedErrorPruneTool.h.
|
private |
! the purity limit for labelling a terminal node as signal
Definition at line 74 of file ExpectedErrorPruneTool.h.
|
private |
! the (optimal) prune sequence
Definition at line 75 of file ExpectedErrorPruneTool.h.