42 fNodeResubstitutionEstimate(-1.0),
43 fResubstitutionEstimate(-1.0),
68 std::string header, title;
82 os <<
"----------------------" << std::endl
86 <<
"g(t): " <<
fAlphaC << std::endl
152 t->
SetAlphaC(std::numeric_limits<double>::infinity( ));
153 t->
SetMinAlphaC(std::numeric_limits<double>::infinity( ));
168 t->
SetAlphaC( std::numeric_limits<double>::infinity( ) );
169 t->
SetMinAlphaC( std::numeric_limits<double>::infinity( ) );
175 std::cout <<
" ERROR in CCTreeWrapper::PruneNode: you try to prune a leaf node.. that does not make sense " << std::endl;
186 for (
UInt_t ievt=0; ievt < validationSample->size(); ievt++) {
189 if (isSignalType == ((*validationSample)[ievt]->
GetClass() == 0)) {
190 ncorrect += (*validationSample)[ievt]->GetWeight();
193 nfalse += (*validationSample)[ievt]->GetWeight();
196 return ncorrect / (ncorrect + nfalse);
213 if (isSignalType == (ev->
GetClass() == 0)) {
220 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)
Class that contains all the data information.
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)
Implementation of a Decision Tree.
Double_t fResubstitutionEstimate
R(t) = misclassification rate for node t.
void SetNLeafDaughters(Int_t N)
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
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)
virtual Double_t GetSeparationIndex(const Double_t s, const Double_t b)=0
Float_t GetPurity(void) const
virtual Bool_t GoesRight(const Event &) const
test event if it descends 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.
Node for the BinarySearch or Decision Trees.
virtual void ReadAttributes(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
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