37 fNodeResubstitutionEstimate(-1.0),
38 fResubstitutionEstimate(-1.0),
63 std::string header, title;
77 os <<
"----------------------" << std::endl
81 <<
"g(t): " <<
fAlphaC << std::endl
147 t->
SetAlphaC(std::numeric_limits<double>::infinity( ));
148 t->
SetMinAlphaC(std::numeric_limits<double>::infinity( ));
163 t->
SetAlphaC( std::numeric_limits<double>::infinity( ) );
164 t->
SetMinAlphaC( std::numeric_limits<double>::infinity( ) );
170 std::cout <<
" ERROR in CCTreeWrapper::PruneNode: you try to prune a leaf node.. that does not make sense " << std::endl;
181 for (
UInt_t ievt=0; ievt < validationSample->size(); ievt++) {
184 if (isSignalType == ((*validationSample)[ievt]->
GetClass() == 0)) {
185 ncorrect += (*validationSample)[ievt]->GetWeight();
188 nfalse += (*validationSample)[ievt]->GetWeight();
191 return ncorrect / (ncorrect + nfalse);
208 if (isSignalType == (ev->
GetClass() == 0)) {
215 return ncorrect / (ncorrect + nfalse);
virtual void PrintRec(std::ostream &os) const =0
virtual ~CCTreeNode()
destructor of a CCTreeNode
CCTreeNode * fRoot
pointer to underlying DecisionTree
virtual void PrintRec(std::ostream &os) const
recursive printout of the node and its daughters
Double_t GetNodePurityLimit() const
CCTreeNode * GetLeftDaughter()
virtual void SetRight(Node *r)
Float_t GetNSigEvents(void) const
Double_t fAlphaC
R(T_t) = sum[t' in ~T_t]{ R(t) }.
virtual DecisionTreeNode * GetRoot() const
virtual void AddContentToNode(std::stringstream &s) const
void SetResubstitutionEstimate(Double_t R)
void InitTree(CCTreeNode *t)
initialize the node t and all its descendants
Double_t CheckEvent(const TMVA::Event &e, Bool_t useYesNoLeaf=false)
return the decision tree output for an event
virtual void SetLeft(Node *l)
Float_t GetNBkgEvents(void) const
CCTreeWrapper(DecisionTree *T, SeparationBase *qualityIndex)
constructor
virtual Node * GetRight() const
virtual Node * GetLeft() const
Double_t GetResubstitutionEstimate() const
Double_t fNodeResubstitutionEstimate
number of terminal descendants
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not...
virtual void ReadContent(std::stringstream &s)
DecisionTree * fDTParent
pointer to the used quality index calculator
CCTreeNode * GetRightDaughter()
Int_t GetNLeafDaughters() const
std::vector< Event * > EventList
Double_t TestTreeQuality(const EventList *validationSample)
return the misclassification rate of a pruned tree for a validation event sample using an EventList ...
SeparationBase * fQualityIndex
void SetNodeResubstitutionEstimate(Double_t R)
Double_t fResubstitutionEstimate
R(t) = misclassification rate for node t.
void SetNLeafDaughters(Int_t N)
void SetMinAlphaC(Double_t alpha)
virtual void Print(std::ostream &os) const
printout of the node (can be read in with ReadDataRecord)
virtual Bool_t ReadDataRecord(std::istream &in, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
initialize a node from a data record
virtual void SetParent(Node *p)
Float_t GetPurity(void) const
virtual Bool_t GoesRight(const Event &) const
test event if it decends the tree at this node to the right
void SetCurrentType(Types::ETreeType type) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
DecisionTreeNode * GetDTNode() const
void SetAlphaC(Double_t alpha)
Abstract ClassifierFactory template that handles arbitrary types.
virtual void ReadAttributes(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
virtual Double_t GetSeparationIndex(const Double_t &s, const Double_t &b)=0
Double_t GetAlphaC() const
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
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
virtual DecisionTreeNode * GetRight() const
~CCTreeWrapper()
destructor
CCTreeNode(DecisionTreeNode *n=NULL)
constructor of the CCTreeNode
Double_t GetMinAlphaC() const
void PruneNode(CCTreeNode *t)
remove the branch rooted at node t
const Event * GetEvent() const
virtual void AddAttributesToNode(void *node) const
Double_t fMinAlphaC
critical point, g(t) = alpha_c(t)
Double_t GetNodeResubstitutionEstimate() const