Logo ROOT  
Reference Guide
DecisionTreeNode.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss, Eckhard von Toerne
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : DecisionTreeNode *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Node for the Decision Tree *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
16  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
17  * Eckhard von Toerne <evt@physik.uni-bonn.de> - U. of Bonn, Germany *
18  * *
19  * Copyright (c) 2009: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
23  * U. of Bonn, Germany *
24  * *
25  * Redistribution and use in source and binary forms, with or without *
26  * modification, are permitted according to the terms listed in LICENSE *
27  * (http://tmva.sourceforge.net/LICENSE) *
28  **********************************************************************************/
29 
30 #ifndef ROOT_TMVA_DecisionTreeNode
31 #define ROOT_TMVA_DecisionTreeNode
32 
33 //////////////////////////////////////////////////////////////////////////
34 // //
35 // DecisionTreeNode //
36 // //
37 // Node for the Decision Tree //
38 // //
39 //////////////////////////////////////////////////////////////////////////
40 
41 #include "TMVA/Node.h"
42 
43 #include "TMVA/Version.h"
44 
45 #include <sstream>
46 #include <vector>
47 #include <string>
48 
49 namespace TMVA {
50 
52  {
53  public:
55  fSampleMax(),
56  fNodeR(0),fSubTreeR(0),fAlpha(0),fG(0),fNTerminal(0),
57  fNB(0),fNS(0),fSumTarget(0),fSumTarget2(0),fCC(0),
58  fNSigEvents ( 0 ), fNBkgEvents ( 0 ),
59  fNEvents ( -1 ),
62  fNEvents_unweighted ( 0 ),
65  fNEvents_unboosted ( 0 ),
66  fSeparationIndex (-1 ),
67  fSeparationGain ( -1 )
68  {
69  }
70  std::vector< Float_t > fSampleMin; // the minima for each ivar of the sample on the node during training
71  std::vector< Float_t > fSampleMax; // the maxima for each ivar of the sample on the node during training
72  Double_t fNodeR; // node resubstitution estimate, R(t)
73  Double_t fSubTreeR; // R(T) = Sum(R(t) : t in ~T)
74  Double_t fAlpha; // critical alpha for this node
75  Double_t fG; // minimum alpha in subtree rooted at this node
76  Int_t fNTerminal; // number of terminal nodes in subtree rooted at this node
77  Double_t fNB; // sum of weights of background events from the pruning sample in this node
78  Double_t fNS; // ditto for the signal events
79  Float_t fSumTarget; // sum of weight*target used for the calculatio of the variance (regression)
80  Float_t fSumTarget2; // sum of weight*target^2 used for the calculatio of the variance (regression)
81  Double_t fCC; // debug variable for cost complexity pruning ..
82 
83  Float_t fNSigEvents; // sum of weights of signal event in the node
84  Float_t fNBkgEvents; // sum of weights of backgr event in the node
85  Float_t fNEvents; // number of events in that entered the node (during training)
86  Float_t fNSigEvents_unweighted; // sum of signal event in the node
87  Float_t fNBkgEvents_unweighted; // sum of backgr event in the node
88  Float_t fNEvents_unweighted; // number of events in that entered the node (during training)
89  Float_t fNSigEvents_unboosted; // sum of signal event in the node
90  Float_t fNBkgEvents_unboosted; // sum of backgr event in the node
91  Float_t fNEvents_unboosted; // number of events in that entered the node (during training)
92  Float_t fSeparationIndex; // measure of "purity" (separation between S and B) AT this node
93  Float_t fSeparationGain; // measure of "purity", separation, or information gained BY this nodes selection
94 
95  // copy constructor
97  fSampleMin(),fSampleMax(), // Samplemin and max are reset in copy constructor
99  fAlpha(n.fAlpha), fG(n.fG),
101  fNB(n.fNB), fNS(n.fNS),
102  fSumTarget(0),fSumTarget2(0), // SumTarget reset in copy constructor
103  fCC(0),
105  fNEvents ( n.fNEvents ),
111  { }
112  };
113 
114  class Event;
115  class MsgLogger;
116 
117  class DecisionTreeNode: public Node {
118 
119  public:
120 
121  // constructor of an essentially "empty" node floating in space
122  DecisionTreeNode ();
123  // constructor of a daughter node as a daughter of 'p'
124  DecisionTreeNode (Node* p, char pos);
125 
126  // copy constructor
127  DecisionTreeNode (const DecisionTreeNode &n, DecisionTreeNode* parent = NULL);
128 
129  // destructor
130  virtual ~DecisionTreeNode();
131 
132  virtual Node* CreateNode() const { return new DecisionTreeNode(); }
133 
134  inline void SetNFisherCoeff(Int_t nvars){fFisherCoeff.resize(nvars);}
135  inline UInt_t GetNFisherCoeff() const { return fFisherCoeff.size();}
136  // set fisher coefficients
137  void SetFisherCoeff(Int_t ivar, Double_t coeff);
138  // get fisher coefficients
139  Double_t GetFisherCoeff(Int_t ivar) const {return fFisherCoeff.at(ivar);}
140 
141  // test event if it decends the tree at this node to the right
142  virtual Bool_t GoesRight( const Event & ) const;
143 
144  // test event if it decends the tree at this node to the left
145  virtual Bool_t GoesLeft ( const Event & ) const;
146 
147  // set index of variable used for discrimination at this node
148  void SetSelector( Short_t i) { fSelector = i; }
149  // return index of variable used for discrimination at this node
150  Short_t GetSelector() const { return fSelector; }
151 
152  // set the cut value applied at this node
153  void SetCutValue ( Float_t c ) { fCutValue = c; }
154  // return the cut value applied at this node
155  Float_t GetCutValue ( void ) const { return fCutValue; }
156 
157  // set true: if event variable > cutValue ==> signal , false otherwise
158  void SetCutType( Bool_t t ) { fCutType = t; }
159  // return kTRUE: Cuts select signal, kFALSE: Cuts select bkg
160  Bool_t GetCutType( void ) const { return fCutType; }
161 
162  // set node type: 1 signal node, -1 bkg leave, 0 intermediate Node
163  void SetNodeType( Int_t t ) { fNodeType = t;}
164  // return node type: 1 signal node, -1 bkg leave, 0 intermediate Node
165  Int_t GetNodeType( void ) const { return fNodeType; }
166 
167  //return S/(S+B) (purity) at this node (from training)
168  Float_t GetPurity( void ) const { return fPurity;}
169  //calculate S/(S+B) (purity) at this node (from training)
170  void SetPurity( void );
171 
172  //set the response of the node (for regression)
174 
175  //return the response of the node (for regression)
176  Float_t GetResponse( void ) const { return fResponse;}
177 
178  //set the RMS of the response of the node (for regression)
179  void SetRMS( Float_t r ) { fRMS = r;}
180 
181  //return the RMS of the response of the node (for regression)
182  Float_t GetRMS( void ) const { return fRMS;}
183 
184  // set the sum of the signal weights in the node
186 
187  // set the sum of the backgr weights in the node
189 
190  // set the number of events that entered the node (during training)
191  void SetNEvents( Float_t nev ){ fTrainInfo->fNEvents =nev ; }
192 
193  // set the sum of the unweighted signal events in the node
195 
196  // set the sum of the unweighted backgr events in the node
198 
199  // set the number of unweighted events that entered the node (during training)
201 
202  // set the sum of the unboosted signal events in the node
204 
205  // set the sum of the unboosted backgr events in the node
207 
208  // set the number of unboosted events that entered the node (during training)
210 
211  // increment the sum of the signal weights in the node
213 
214  // increment the sum of the backgr weights in the node
216 
217  // increment the number of events that entered the node (during training)
218  void IncrementNEvents( Float_t nev ){ fTrainInfo->fNEvents +=nev ; }
219 
220  // increment the sum of the signal weights in the node
222 
223  // increment the sum of the backgr weights in the node
225 
226  // increment the number of events that entered the node (during training)
228 
229  // return the sum of the signal weights in the node
230  Float_t GetNSigEvents( void ) const { return fTrainInfo->fNSigEvents; }
231 
232  // return the sum of the backgr weights in the node
233  Float_t GetNBkgEvents( void ) const { return fTrainInfo->fNBkgEvents; }
234 
235  // return the number of events that entered the node (during training)
236  Float_t GetNEvents( void ) const { return fTrainInfo->fNEvents; }
237 
238  // return the sum of unweighted signal weights in the node
240 
241  // return the sum of unweighted backgr weights in the node
243 
244  // return the number of unweighted events that entered the node (during training)
246 
247  // return the sum of unboosted signal weights in the node
249 
250  // return the sum of unboosted backgr weights in the node
252 
253  // return the number of unboosted events that entered the node (during training)
255 
256 
257  // set the choosen index, measure of "purity" (separation between S and B) AT this node
259  // return the separation index AT this node
261 
262  // set the separation, or information gained BY this nodes selection
264  // return the gain in separation obtained by this nodes selection
266 
267  // printout of the node
268  virtual void Print( std::ostream& os ) const;
269 
270  // recursively print the node and its daughters (--> print the 'tree')
271  virtual void PrintRec( std::ostream& os ) const;
272 
273  virtual void AddAttributesToNode(void* node) const;
274  virtual void AddContentToNode(std::stringstream& s) const;
275 
276  // recursively clear the nodes content (S/N etc, but not the cut criteria)
278 
279  // get pointers to children, mother in the tree
280 
281  // return pointer to the left/right daughter or parent node
282  inline virtual DecisionTreeNode* GetLeft( ) const { return static_cast<DecisionTreeNode*>(fLeft); }
283  inline virtual DecisionTreeNode* GetRight( ) const { return static_cast<DecisionTreeNode*>(fRight); }
284  inline virtual DecisionTreeNode* GetParent( ) const { return static_cast<DecisionTreeNode*>(fParent); }
285 
286  // set pointer to the left/right daughter and parent node
287  inline virtual void SetLeft (Node* l) { fLeft = l;}
288  inline virtual void SetRight (Node* r) { fRight = r;}
289  inline virtual void SetParent(Node* p) { fParent = p;}
290 
291 
292 
293 
294  // the node resubstitution estimate, R(t), for Cost Complexity pruning
295  inline void SetNodeR( Double_t r ) { fTrainInfo->fNodeR = r; }
296  inline Double_t GetNodeR( ) const { return fTrainInfo->fNodeR; }
297 
298  // the resubstitution estimate, R(T_t), of the tree rooted at this node
299  inline void SetSubTreeR( Double_t r ) { fTrainInfo->fSubTreeR = r; }
300  inline Double_t GetSubTreeR( ) const { return fTrainInfo->fSubTreeR; }
301 
302  // R(t) - R(T_t)
303  // the critical point alpha = -------------
304  // |~T_t| - 1
305  inline void SetAlpha( Double_t alpha ) { fTrainInfo->fAlpha = alpha; }
306  inline Double_t GetAlpha( ) const { return fTrainInfo->fAlpha; }
307 
308  // the minimum alpha in the tree rooted at this node
309  inline void SetAlphaMinSubtree( Double_t g ) { fTrainInfo->fG = g; }
310  inline Double_t GetAlphaMinSubtree( ) const { return fTrainInfo->fG; }
311 
312  // number of terminal nodes in the subtree rooted here
313  inline void SetNTerminal( Int_t n ) { fTrainInfo->fNTerminal = n; }
314  inline Int_t GetNTerminal( ) const { return fTrainInfo->fNTerminal; }
315 
316  // number of background/signal events from the pruning validation sample
317  inline void SetNBValidation( Double_t b ) { fTrainInfo->fNB = b; }
318  inline void SetNSValidation( Double_t s ) { fTrainInfo->fNS = s; }
319  inline Double_t GetNBValidation( ) const { return fTrainInfo->fNB; }
320  inline Double_t GetNSValidation( ) const { return fTrainInfo->fNS; }
321 
322 
323  inline void SetSumTarget(Float_t t) {fTrainInfo->fSumTarget = t; }
324  inline void SetSumTarget2(Float_t t2){fTrainInfo->fSumTarget2 = t2; }
325 
326  inline void AddToSumTarget(Float_t t) {fTrainInfo->fSumTarget += t; }
327  inline void AddToSumTarget2(Float_t t2){fTrainInfo->fSumTarget2 += t2; }
328 
329  inline Float_t GetSumTarget() const {return fTrainInfo? fTrainInfo->fSumTarget : -9999;}
330  inline Float_t GetSumTarget2() const {return fTrainInfo? fTrainInfo->fSumTarget2: -9999;}
331 
332 
333  // reset the pruning validation data
334  void ResetValidationData( );
335 
336  // flag indicates whether this node is terminal
337  inline Bool_t IsTerminal() const { return fIsTerminalNode; }
338  inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s; }
339  void PrintPrune( std::ostream& os ) const ;
340  void PrintRecPrune( std::ostream& os ) const;
341 
342  void SetCC(Double_t cc);
343  Double_t GetCC() const {return (fTrainInfo? fTrainInfo->fCC : -1.);}
344 
345  Float_t GetSampleMin(UInt_t ivar) const;
346  Float_t GetSampleMax(UInt_t ivar) const;
347  void SetSampleMin(UInt_t ivar, Float_t xmin);
348  void SetSampleMax(UInt_t ivar, Float_t xmax);
349 
350  static void SetIsTraining(bool on);
351  static void SetTmvaVersionCode(UInt_t code);
352 
353  static bool IsTraining();
354  static UInt_t GetTmvaVersionCode();
355 
356  virtual Bool_t ReadDataRecord( std::istream& is, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
357  virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
358  virtual void ReadContent(std::stringstream& s);
359 
360  protected:
361 
362  static MsgLogger& Log();
363 
364  static bool fgIsTraining; // static variable to flag training phase in which we need fTrainInfo
365  static UInt_t fgTmva_Version_Code; // set only when read from weightfile
366 
367  std::vector<Double_t> fFisherCoeff; // the fisher coeff (offset at the last element)
368 
369  Float_t fCutValue; // cut value appplied on this node to discriminate bkg against sig
370  Bool_t fCutType; // true: if event variable > cutValue ==> signal , false otherwise
371  Short_t fSelector; // index of variable used in node selection (decision tree)
372 
373  Float_t fResponse; // response value in case of regression
374  Float_t fRMS; // response RMS of the regression node
375  Int_t fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Signal-leaf, 0 = internal
376  Float_t fPurity; // the node purity
377 
378  Bool_t fIsTerminalNode; //! flag to set node as terminal (i.e., without deleting its descendants)
379 
381 
382  private:
383 
384  ClassDef(DecisionTreeNode,0); // Node for the Decision Tree
385  };
386 } // namespace TMVA
387 
388 #endif
c
#define c(i)
Definition: RSha256.hxx:101
l
auto * l
Definition: textangle.C:4
TMVA::DecisionTreeNode::PrintRec
virtual void PrintRec(std::ostream &os) const
recursively print the node and its daughters (--> print the 'tree')
Definition: DecisionTreeNode.cxx:241
TMVA::DecisionTreeNode::ReadDataRecord
virtual Bool_t ReadDataRecord(std::istream &is, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
Read the data block.
Definition: DecisionTreeNode.cxx:272
TMVA::DecisionTreeNode::fCutType
Bool_t fCutType
Definition: DecisionTreeNode.h:370
TMVA::DecisionTreeNode::SetSeparationIndex
void SetSeparationIndex(Float_t sep)
Definition: DecisionTreeNode.h:258
n
const Int_t n
Definition: legend1.C:16
TMVA::DTNodeTrainingInfo::fSumTarget
Float_t fSumTarget
Definition: DecisionTreeNode.h:79
TMVA::DecisionTreeNode::fIsTerminalNode
Bool_t fIsTerminalNode
Definition: DecisionTreeNode.h:378
TMVA::DecisionTreeNode::GetNEvents_unboosted
Float_t GetNEvents_unboosted(void) const
Definition: DecisionTreeNode.h:254
TMVA::DecisionTreeNode::fResponse
Float_t fResponse
Definition: DecisionTreeNode.h:373
TMVA::DecisionTreeNode::GetAlpha
Double_t GetAlpha() const
Definition: DecisionTreeNode.h:306
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TMVA::DecisionTreeNode::IncrementNBkgEvents_unweighted
void IncrementNBkgEvents_unweighted()
Definition: DecisionTreeNode.h:224
TMVA::DecisionTreeNode::SetCC
void SetCC(Double_t cc)
Definition: DecisionTreeNode.cxx:403
TMVA::DecisionTreeNode::CreateNode
virtual Node * CreateNode() const
Definition: DecisionTreeNode.h:132
TMVA::DecisionTreeNode::GetSampleMax
Float_t GetSampleMax(UInt_t ivar) const
return the maximum of variable ivar from the training sample that pass/end up in this node
Definition: DecisionTreeNode.cxx:424
TMVA::DecisionTreeNode::SetIsTraining
static void SetIsTraining(bool on)
Definition: DecisionTreeNode.cxx:546
TMVA::Node::fParent
Node * fParent
Definition: Node.h:138
TMVA::DecisionTreeNode::SetNSigEvents_unweighted
void SetNSigEvents_unweighted(Float_t s)
Definition: DecisionTreeNode.h:194
TMVA::DecisionTreeNode::fgIsTraining
static bool fgIsTraining
Definition: DecisionTreeNode.h:364
TMVA::DecisionTreeNode::SetNTerminal
void SetNTerminal(Int_t n)
Definition: DecisionTreeNode.h:313
TMVA::DecisionTreeNode::AddToSumTarget
void AddToSumTarget(Float_t t)
Definition: DecisionTreeNode.h:326
TMVA::DecisionTreeNode::IsTraining
static bool IsTraining()
Definition: DecisionTreeNode.cxx:554
TMVA::DecisionTreeNode::SetNBkgEvents_unboosted
void SetNBkgEvents_unboosted(Float_t b)
Definition: DecisionTreeNode.h:206
TMVA::DecisionTreeNode::IncrementNEvents
void IncrementNEvents(Float_t nev)
Definition: DecisionTreeNode.h:218
TMVA::DecisionTreeNode::GetNodeType
Int_t GetNodeType(void) const
Definition: DecisionTreeNode.h:165
TMVA::DecisionTreeNode::SetSeparationGain
void SetSeparationGain(Float_t sep)
Definition: DecisionTreeNode.h:263
TMVA::DecisionTreeNode::SetNBkgEvents_unweighted
void SetNBkgEvents_unweighted(Float_t b)
Definition: DecisionTreeNode.h:197
TMVA::DecisionTreeNode::GetNodeR
Double_t GetNodeR() const
Definition: DecisionTreeNode.h:296
TMVA::DecisionTreeNode::PrintPrune
void PrintPrune(std::ostream &os) const
printout of the node (can be read in with ReadDataRecord)
Definition: DecisionTreeNode.cxx:381
TMVA::DecisionTreeNode::GetRMS
Float_t GetRMS(void) const
Definition: DecisionTreeNode.h:182
r
ROOT::R::TRInterface & r
Definition: Object.C:4
xmax
float xmax
Definition: THbookFile.cxx:95
TMVA::DecisionTreeNode::GetSubTreeR
Double_t GetSubTreeR() const
Definition: DecisionTreeNode.h:300
TMVA::DecisionTreeNode::fgTmva_Version_Code
static UInt_t fgTmva_Version_Code
Definition: DecisionTreeNode.h:365
TMVA::DecisionTreeNode::ClearNodeAndAllDaughters
void ClearNodeAndAllDaughters()
clear the nodes (their S/N, Nevents etc), just keep the structure of the tree
Definition: DecisionTreeNode.cxx:346
TMVA::DecisionTreeNode::GetSeparationGain
Float_t GetSeparationGain(void) const
Definition: DecisionTreeNode.h:265
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TMVA::DecisionTreeNode::SetResponse
void SetResponse(Float_t r)
Definition: DecisionTreeNode.h:173
TMVA::DecisionTreeNode::GoesRight
virtual Bool_t GoesRight(const Event &) const
test event if it descends the tree at this node to the right
Definition: DecisionTreeNode.cxx:155
TMVA::DecisionTreeNode::SetCutType
void SetCutType(Bool_t t)
Definition: DecisionTreeNode.h:158
TMVA::DecisionTreeNode::SetNSigEvents
void SetNSigEvents(Float_t s)
Definition: DecisionTreeNode.h:185
TMVA::DTNodeTrainingInfo::fCC
Double_t fCC
Definition: DecisionTreeNode.h:81
TMVA::DecisionTreeNode::GetNSValidation
Double_t GetNSValidation() const
Definition: DecisionTreeNode.h:320
TMVA::DTNodeTrainingInfo::fNTerminal
Int_t fNTerminal
Definition: DecisionTreeNode.h:76
TMVA::DecisionTreeNode::Log
static MsgLogger & Log()
Definition: DecisionTreeNode.cxx:540
TMVA::DecisionTreeNode
Definition: DecisionTreeNode.h:117
TMVA::DecisionTreeNode::SetSampleMax
void SetSampleMax(UInt_t ivar, Float_t xmax)
set the maximum of variable ivar from the training sample that pass/end up in this node
Definition: DecisionTreeNode.cxx:446
TMVA::DTNodeTrainingInfo::fNSigEvents_unweighted
Float_t fNSigEvents_unweighted
Definition: DecisionTreeNode.h:86
TMVA::DTNodeTrainingInfo::fSampleMin
std::vector< Float_t > fSampleMin
Definition: DecisionTreeNode.h:70
TMVA::DecisionTreeNode::SetParent
virtual void SetParent(Node *p)
Definition: DecisionTreeNode.h:289
TMVA::DTNodeTrainingInfo::fNEvents_unboosted
Float_t fNEvents_unboosted
Definition: DecisionTreeNode.h:91
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMVA::DecisionTreeNode::IsTerminal
Bool_t IsTerminal() const
Definition: DecisionTreeNode.h:337
TMVA::DecisionTreeNode::SetCutValue
void SetCutValue(Float_t c)
Definition: DecisionTreeNode.h:153
b
#define b(i)
Definition: RSha256.hxx:100
TMVA::DecisionTreeNode::GetFisherCoeff
Double_t GetFisherCoeff(Int_t ivar) const
Definition: DecisionTreeNode.h:139
TMVA::Node
Node for the BinarySearch or Decision Trees.
Definition: Node.h:58
bool
TMVA::DecisionTreeNode::GetNBkgEvents_unboosted
Float_t GetNBkgEvents_unboosted(void) const
Definition: DecisionTreeNode.h:251
TMVA::DecisionTreeNode::SetNEvents_unboosted
void SetNEvents_unboosted(Float_t nev)
Definition: DecisionTreeNode.h:209
Version.h
TMVA::DTNodeTrainingInfo::fNSigEvents_unboosted
Float_t fNSigEvents_unboosted
Definition: DecisionTreeNode.h:89
TMVA::DecisionTreeNode::fPurity
Float_t fPurity
Definition: DecisionTreeNode.h:376
TMVA::DTNodeTrainingInfo::fNEvents
Float_t fNEvents
Definition: DecisionTreeNode.h:85
TMVA::DecisionTreeNode::GetNSigEvents
Float_t GetNSigEvents(void) const
Definition: DecisionTreeNode.h:230
TMVA::DecisionTreeNode::GetNBValidation
Double_t GetNBValidation() const
Definition: DecisionTreeNode.h:319
TMVA::DecisionTreeNode::fNodeType
Int_t fNodeType
Definition: DecisionTreeNode.h:375
TMVA::DecisionTreeNode::SetFisherCoeff
void SetFisherCoeff(Int_t ivar, Double_t coeff)
set fisher coefficients
Definition: DecisionTreeNode.cxx:515
TMVA::DecisionTreeNode::GetSumTarget2
Float_t GetSumTarget2() const
Definition: DecisionTreeNode.h:330
TMVA::DecisionTreeNode::SetNodeR
void SetNodeR(Double_t r)
Definition: DecisionTreeNode.h:295
TMVA::DecisionTreeNode::GetNBkgEvents_unweighted
Float_t GetNBkgEvents_unweighted(void) const
Definition: DecisionTreeNode.h:242
TMVA::DecisionTreeNode::SetNEvents_unweighted
void SetNEvents_unweighted(Float_t nev)
Definition: DecisionTreeNode.h:200
TMVA::DecisionTreeNode::~DecisionTreeNode
virtual ~DecisionTreeNode()
destructor
Definition: DecisionTreeNode.cxx:148
xmin
float xmin
Definition: THbookFile.cxx:95
TMVA::DecisionTreeNode::SetSampleMin
void SetSampleMin(UInt_t ivar, Float_t xmin)
set the minimum of variable ivar from the training sample that pass/end up in this node
Definition: DecisionTreeNode.cxx:435
TMVA::DecisionTreeNode::GetLeft
virtual DecisionTreeNode * GetLeft() const
Definition: DecisionTreeNode.h:282
TMVA::DecisionTreeNode::IncrementNSigEvents
void IncrementNSigEvents(Float_t s)
Definition: DecisionTreeNode.h:212
TMVA::DecisionTreeNode::SetSumTarget2
void SetSumTarget2(Float_t t2)
Definition: DecisionTreeNode.h:324
TMVA::DecisionTreeNode::GetNBkgEvents
Float_t GetNBkgEvents(void) const
Definition: DecisionTreeNode.h:233
TMVA::DecisionTreeNode::PrintRecPrune
void PrintRecPrune(std::ostream &os) const
recursive printout of the node and its daughters
Definition: DecisionTreeNode.cxx:393
TMVA::DecisionTreeNode::SetNBValidation
void SetNBValidation(Double_t b)
Definition: DecisionTreeNode.h:317
TMVA::DTNodeTrainingInfo
Definition: DecisionTreeNode.h:52
TMVA::DTNodeTrainingInfo::fSumTarget2
Float_t fSumTarget2
Definition: DecisionTreeNode.h:80
Node.h
TMVA::DecisionTreeNode::SetPurity
void SetPurity(void)
return the S/(S+B) (purity) for the node REM: even if nodes with purity 0.01 are very PURE background...
Definition: DecisionTreeNode.cxx:191
TMVA::DTNodeTrainingInfo::fG
Double_t fG
Definition: DecisionTreeNode.h:75
TMVA::DecisionTreeNode::GetSelector
Short_t GetSelector() const
Definition: DecisionTreeNode.h:150
TMVA::DecisionTreeNode::SetNEvents
void SetNEvents(Float_t nev)
Definition: DecisionTreeNode.h:191
TMVA::DecisionTreeNode::GetPurity
Float_t GetPurity(void) const
Definition: DecisionTreeNode.h:168
TMVA::DecisionTreeNode::SetRMS
void SetRMS(Float_t r)
Definition: DecisionTreeNode.h:179
TMVA::DecisionTreeNode::GetTmvaVersionCode
static UInt_t GetTmvaVersionCode()
Definition: DecisionTreeNode.cxx:558
TMVA::DTNodeTrainingInfo::fNB
Double_t fNB
Definition: DecisionTreeNode.h:77
TMVA::DecisionTreeNode::GetCC
Double_t GetCC() const
Definition: DecisionTreeNode.h:343
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TMVA::DecisionTreeNode::SetSubTreeR
void SetSubTreeR(Double_t r)
Definition: DecisionTreeNode.h:299
TMVA::DTNodeTrainingInfo::fNSigEvents
Float_t fNSigEvents
Definition: DecisionTreeNode.h:83
TMVA::DecisionTreeNode::GoesLeft
virtual Bool_t GoesLeft(const Event &) const
test event if it descends the tree at this node to the left
Definition: DecisionTreeNode.cxx:179
Short_t
short Short_t
Definition: RtypesCore.h:39
TMVA::DecisionTreeNode::GetCutType
Bool_t GetCutType(void) const
Definition: DecisionTreeNode.h:160
TMVA::DTNodeTrainingInfo::fNBkgEvents_unweighted
Float_t fNBkgEvents_unweighted
Definition: DecisionTreeNode.h:87
TMVA::DTNodeTrainingInfo::fSeparationIndex
Float_t fSeparationIndex
Definition: DecisionTreeNode.h:92
TMVA::DecisionTreeNode::SetLeft
virtual void SetLeft(Node *l)
Definition: DecisionTreeNode.h:287
TMVA::DecisionTreeNode::ReadAttributes
virtual void ReadAttributes(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
Definition: DecisionTreeNode.cxx:455
TMVA::DecisionTreeNode::AddAttributesToNode
virtual void AddAttributesToNode(void *node) const
add attribute to xml
Definition: DecisionTreeNode.cxx:492
TMVA::DecisionTreeNode::AddContentToNode
virtual void AddContentToNode(std::stringstream &s) const
adding attributes to tree node (well, was used in BinarySearchTree, and somehow I guess someone progr...
Definition: DecisionTreeNode.cxx:526
unsigned int
TMVA::DecisionTreeNode::GetSumTarget
Float_t GetSumTarget() const
Definition: DecisionTreeNode.h:329
TMVA::DecisionTreeNode::GetNSigEvents_unweighted
Float_t GetNSigEvents_unweighted(void) const
Definition: DecisionTreeNode.h:239
TMVA::DecisionTreeNode::GetCutValue
Float_t GetCutValue(void) const
Definition: DecisionTreeNode.h:155
TMVA::Node::fRight
Node * fRight
Definition: Node.h:140
TMVA::DecisionTreeNode::AddToSumTarget2
void AddToSumTarget2(Float_t t2)
Definition: DecisionTreeNode.h:327
TMVA::DecisionTreeNode::fCutValue
Float_t fCutValue
Definition: DecisionTreeNode.h:369
TMVA::DecisionTreeNode::SetNSigEvents_unboosted
void SetNSigEvents_unboosted(Float_t s)
Definition: DecisionTreeNode.h:203
TMVA::DecisionTreeNode::SetNodeType
void SetNodeType(Int_t t)
Definition: DecisionTreeNode.h:163
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MsgLogger
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
TMVA::DecisionTreeNode::SetTmvaVersionCode
static void SetTmvaVersionCode(UInt_t code)
Definition: DecisionTreeNode.cxx:550
TMVA::DTNodeTrainingInfo::fSeparationGain
Float_t fSeparationGain
Definition: DecisionTreeNode.h:93
TMVA::DTNodeTrainingInfo::fNEvents_unweighted
Float_t fNEvents_unweighted
Definition: DecisionTreeNode.h:88
TMVA_VERSION_CODE
#define TMVA_VERSION_CODE
Definition: Version.h:47
TMVA::DTNodeTrainingInfo::DTNodeTrainingInfo
DTNodeTrainingInfo(const DTNodeTrainingInfo &n)
Definition: DecisionTreeNode.h:96
TMVA::DecisionTreeNode::GetAlphaMinSubtree
Double_t GetAlphaMinSubtree() const
Definition: DecisionTreeNode.h:310
TMVA::DecisionTreeNode::GetNFisherCoeff
UInt_t GetNFisherCoeff() const
Definition: DecisionTreeNode.h:135
TMVA::DecisionTreeNode::DecisionTreeNode
DecisionTreeNode()
constructor of an essentially "empty" node floating in space
Definition: DecisionTreeNode.cxx:67
TMVA::Event
Definition: Event.h:51
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::DTNodeTrainingInfo::fNodeR
Double_t fNodeR
Definition: DecisionTreeNode.h:72
TMVA::DecisionTreeNode::SetNSValidation
void SetNSValidation(Double_t s)
Definition: DecisionTreeNode.h:318
TMVA::DTNodeTrainingInfo::fSampleMax
std::vector< Float_t > fSampleMax
Definition: DecisionTreeNode.h:71
TMVA::DecisionTreeNode::GetNEvents_unweighted
Float_t GetNEvents_unweighted(void) const
Definition: DecisionTreeNode.h:245
TMVA::DecisionTreeNode::IncrementNEvents_unweighted
void IncrementNEvents_unweighted()
Definition: DecisionTreeNode.h:227
TMVA::DecisionTreeNode::ResetValidationData
void ResetValidationData()
temporary stored node values (number of events, etc.) that originate not from the training but from t...
Definition: DecisionTreeNode.cxx:366
TMVA::DTNodeTrainingInfo::fAlpha
Double_t fAlpha
Definition: DecisionTreeNode.h:74
TMVA::Node::fLeft
Node * fLeft
Definition: Node.h:139
TMVA::DTNodeTrainingInfo::fNBkgEvents
Float_t fNBkgEvents
Definition: DecisionTreeNode.h:84
TMVA::DTNodeTrainingInfo::DTNodeTrainingInfo
DTNodeTrainingInfo()
Definition: DecisionTreeNode.h:54
TMVA::DecisionTreeNode::SetNFisherCoeff
void SetNFisherCoeff(Int_t nvars)
Definition: DecisionTreeNode.h:134
TMVA::DTNodeTrainingInfo::fSubTreeR
Double_t fSubTreeR
Definition: DecisionTreeNode.h:73
TMVA::DecisionTreeNode::GetNTerminal
Int_t GetNTerminal() const
Definition: DecisionTreeNode.h:314
TMVA::DecisionTreeNode::SetAlpha
void SetAlpha(Double_t alpha)
Definition: DecisionTreeNode.h:305
TMVA::DecisionTreeNode::fFisherCoeff
std::vector< Double_t > fFisherCoeff
Definition: DecisionTreeNode.h:367
TMVA::DecisionTreeNode::SetTerminal
void SetTerminal(Bool_t s=kTRUE)
Definition: DecisionTreeNode.h:338
TMVA::DTNodeTrainingInfo::fNS
Double_t fNS
Definition: DecisionTreeNode.h:78
TMVA::DecisionTreeNode::GetResponse
Float_t GetResponse(void) const
Definition: DecisionTreeNode.h:176
TMVA::DecisionTreeNode::IncrementNBkgEvents
void IncrementNBkgEvents(Float_t b)
Definition: DecisionTreeNode.h:215
ROOT::Math::detail::sep
@ sep
Definition: GenVectorIO.h:35
TMVA::DecisionTreeNode::fSelector
Short_t fSelector
Definition: DecisionTreeNode.h:371
TMVA::DecisionTreeNode::SetSelector
void SetSelector(Short_t i)
Definition: DecisionTreeNode.h:148
TMVA::DecisionTreeNode::GetRight
virtual DecisionTreeNode * GetRight() const
Definition: DecisionTreeNode.h:283
TMVA::DTNodeTrainingInfo::fNBkgEvents_unboosted
Float_t fNBkgEvents_unboosted
Definition: DecisionTreeNode.h:90
TMVA::DecisionTreeNode::ReadContent
virtual void ReadContent(std::stringstream &s)
reading attributes from tree node (well, was used in BinarySearchTree, and somehow I guess someone pr...
Definition: DecisionTreeNode.cxx:535
TMVA::DecisionTreeNode::SetRight
virtual void SetRight(Node *r)
Definition: DecisionTreeNode.h:288
TMVA::DecisionTreeNode::SetNBkgEvents
void SetNBkgEvents(Float_t b)
Definition: DecisionTreeNode.h:188
TMVA::DecisionTreeNode::IncrementNSigEvents_unweighted
void IncrementNSigEvents_unweighted()
Definition: DecisionTreeNode.h:221
TMVA::DecisionTreeNode::GetSampleMin
Float_t GetSampleMin(UInt_t ivar) const
return the minimum of variable ivar from the training sample that pass/end up in this node
Definition: DecisionTreeNode.cxx:413
TMVA::DecisionTreeNode::GetNSigEvents_unboosted
Float_t GetNSigEvents_unboosted(void) const
Definition: DecisionTreeNode.h:248
TMVA::DecisionTreeNode::SetSumTarget
void SetSumTarget(Float_t t)
Definition: DecisionTreeNode.h:323
TMVA::DecisionTreeNode::GetParent
virtual DecisionTreeNode * GetParent() const
Definition: DecisionTreeNode.h:284
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
TMVA::DecisionTreeNode::GetSeparationIndex
Float_t GetSeparationIndex(void) const
Definition: DecisionTreeNode.h:260
TMVA::DecisionTreeNode::GetNEvents
Float_t GetNEvents(void) const
Definition: DecisionTreeNode.h:236
TMVA::DecisionTreeNode::fTrainInfo
DTNodeTrainingInfo * fTrainInfo
flag to set node as terminal (i.e., without deleting its descendants)
Definition: DecisionTreeNode.h:380
TMVA::DecisionTreeNode::Print
virtual void Print(std::ostream &os) const
print the node
Definition: DecisionTreeNode.cxx:209
int
TMVA::DecisionTreeNode::fRMS
Float_t fRMS
Definition: DecisionTreeNode.h:374
TMVA::DecisionTreeNode::SetAlphaMinSubtree
void SetAlphaMinSubtree(Double_t g)
Definition: DecisionTreeNode.h:309
g
#define g(i)
Definition: RSha256.hxx:105