197 Log() << kINFO <<
"Zero events in purity calculation , return purity=0.5" <<
Endl;
198 std::ostringstream oss;
211 os <<
"< *** " << std::endl;
213 << std::setprecision(6)
230 os <<
"My address is " << long(
this) <<
", ";
232 if (this->
GetLeft() != NULL) os <<
" left daughter at addr: " << long(this->
GetLeft());
233 if (this->
GetRight() != NULL) os <<
" right daughter at addr: " << long(this->
GetRight()) ;
235 os <<
" **** > " << std::endl;
244 << std::setprecision(6)
260 <<
" rms: " << this->
GetRMS()
262 if (this->
GetCC() > 10000000000000.) os <<
" CC: " << 100000. << std::endl;
263 else os <<
" CC: " << this->
GetCC() << std::endl;
277 Float_t cutVal, cutType, nsig, nbkg, nEv, nsig_unweighted, nbkg_unweighted, nEv_unweighted;
278 Float_t separationIndex, separationGain, response(-99), cc(0);
279 Int_t depth, ivar, nodeType;
284 if ( depth==-1 ) {
return kFALSE; }
298 >> tmp >> nsig_unweighted
299 >> tmp >> nbkg_unweighted
300 >> tmp >> nEv_unweighted
301 >> tmp >> separationIndex
302 >> tmp >> separationGain
312 >> tmp >> nsig_unweighted
313 >> tmp >> nbkg_unweighted
314 >> tmp >> nEv_unweighted
315 >> tmp >> separationIndex
316 >> tmp >> separationGain
382 os <<
"----------------------" << std::endl
384 <<
"R(t): " <<
GetNodeR() << std::endl
386 <<
"g(t): " <<
GetAlpha() << std::endl
406 else Log() << kFATAL <<
"call to SetCC without trainingInfo" <<
Endl;
415 else Log() << kFATAL <<
"You asked for Min of the event sample in node for variable " 416 << ivar <<
" that is out of range" <<
Endl;
426 else Log() << kFATAL <<
"You asked for Max of the event sample in node for variable " 427 << ivar <<
" that is out of range" <<
Endl;
457 Float_t tempNSigEvents,tempNBkgEvents;
460 if (
gTools().HasAttr(node,
"NCoef")){
477 if(
gTools().HasAttr(node,
"purity") ) {
482 fPurity = tempNSigEvents / (tempNSigEvents + tempNBkgEvents);
541 TTHREAD_TLS_DECL_ARG(
MsgLogger,logger,
"DecisionTreeNode");
Float_t GetRMS(void) const
Float_t GetValueFast(UInt_t ivar) const
virtual void ReadAttributes(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
DTNodeTrainingInfo * fTrainInfo
flag to set node as terminal (i.e., without deleting its descendants)
virtual void AddAttributesToNode(void *node) const
add attribute to xml
void SetSelector(Short_t i)
MsgLogger & Endl(MsgLogger &ml)
void SetFisherCoeff(Int_t ivar, Double_t coeff)
set fisher coefficients
Float_t GetNEvents(void) const
virtual Bool_t GoesLeft(const Event &) const
test event if it descends the tree at this node to the left
virtual void Print(std::ostream &os) const
print the node
Float_t GetNBkgEvents_unweighted(void) const
virtual void PrintRec(std::ostream &os) const
recursively print the node and its daughters (–> print the 'tree')
virtual void ReadContent(std::stringstream &s)
reading attributes from tree node (well, was used in BinarySearchTree, and somehow I guess someone pr...
void PrintPrune(std::ostream &os) const
printout of the node (can be read in with ReadDataRecord)
std::vector< Float_t > fSampleMax
virtual DecisionTreeNode * GetParent() const
Float_t GetSampleMax(UInt_t ivar) const
return the maximum of variable ivar from the training sample that pass/end up in this node ...
DecisionTreeNode()
constructor of an essentially "empty" node floating in space
virtual void SetRight(Node *r)
Bool_t GetCutType(void) const
Float_t GetNSigEvents(void) const
std::vector< Float_t > fSampleMin
void SetNSigEvents_unweighted(Float_t s)
void SetNBValidation(Double_t b)
void SetNFisherCoeff(Int_t nvars)
Double_t GetSubTreeR() const
Float_t GetSeparationIndex(void) const
Float_t GetNBkgEvents(void) const
Float_t GetSampleMin(UInt_t ivar) const
return the minimum of variable ivar from the training sample that pass/end up in this node ...
Float_t GetCutValue(void) const
Double_t GetNodeR() const
UInt_t GetNFisherCoeff() const
void SetSeparationGain(Float_t sep)
void ResetValidationData()
temporary stored node values (number of events, etc.) that originate not from the training but from t...
void SetNBkgEvents(Float_t b)
void SetNSValidation(Double_t s)
virtual void AddContentToNode(std::stringstream &s) const
adding attributes to tree node (well, was used in BinarySearchTree, and somehow I guess someone progr...
void SetNEvents(Float_t nev)
void SetSumTarget2(Float_t t2)
Float_t GetNSigEvents_unweighted(void) const
Int_t GetNodeType(void) const
virtual void SetLeft(Node *l)
Double_t GetFisherCoeff(Int_t ivar) const
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 ...
void SetCutValue(Float_t c)
char * Form(const char *fmt,...)
void SetPurity(void)
return the S/(S+B) (purity) for the node REM: even if nodes with purity 0.01 are very PURE background...
void SetCutType(Bool_t t)
void SetSumTarget(Float_t t)
virtual void SetParent(Node *p)
Double_t GetAlphaMinSubtree() const
Float_t GetPurity(void) const
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 ...
#define TMVA_VERSION(a, b, c)
static UInt_t fgTmva_Version_Code
virtual Bool_t GoesRight(const Event &) const
test event if it descends the tree at this node to the right
void SetNodeType(Int_t t)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Float_t GetNEvents_unweighted(void) const
void PrintRecPrune(std::ostream &os) const
recursive printout of the node and its daughters
void SetNSigEvents(Float_t s)
ostringstream derivative to redirect and format output
void SetNBkgEvents_unweighted(Float_t b)
Abstract ClassifierFactory template that handles arbitrary types.
Node for the BinarySearch or Decision Trees.
virtual Bool_t ReadDataRecord(std::istream &is, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
Read the data block.
Float_t GetResponse(void) const
virtual DecisionTreeNode * GetLeft() const
virtual DecisionTreeNode * GetRight() const
std::vector< Double_t > fFisherCoeff
void ClearNodeAndAllDaughters()
clear the nodes (their S/N, Nevents etc), just keep the structure of the tree
void SetSeparationIndex(Float_t sep)
Double_t GetAlpha() const
Short_t GetSelector() const
Int_t GetNTerminal() const
virtual ~DecisionTreeNode()
destructor
Float_t GetSeparationGain(void) const
void SetNEvents_unweighted(Float_t nev)