195 Log() <<
kINFO <<
"Zero events in purity calcuation , return purity=0.5" <<
Endl;
196 std::ostringstream oss;
210 os <<
"< *** " << std::endl;
212 << std::setprecision(6)
229 os <<
"My address is " << long(
this) <<
", ";
231 if (this->
GetLeft() !=
NULL) os <<
" left daughter at addr: " << long(this->
GetLeft());
234 os <<
" **** > " << std::endl;
243 << std::setprecision(6)
259 <<
" rms: " << this->
GetRMS()
261 if (this->
GetCC() > 10000000000000.) os <<
" CC: " << 100000. << std::endl;
262 else os <<
" CC: " << this->
GetCC() << std::endl;
276 Float_t cutVal, cutType, nsig, nbkg, nEv, nsig_unweighted, nbkg_unweighted, nEv_unweighted;
277 Float_t separationIndex, separationGain, response(-99), cc(0);
278 Int_t depth, ivar, nodeType;
283 if ( depth==-1 ) {
return kFALSE; }
297 >> tmp >> nsig_unweighted
298 >> tmp >> nbkg_unweighted
299 >> tmp >> nEv_unweighted
300 >> tmp >> separationIndex
301 >> tmp >> separationGain
311 >> tmp >> nsig_unweighted
312 >> tmp >> nbkg_unweighted
313 >> tmp >> nEv_unweighted
314 >> tmp >> separationIndex
315 >> tmp >> separationGain
381 os <<
"----------------------" << std::endl
383 <<
"R(t): " <<
GetNodeR() << std::endl
385 <<
"g(t): " <<
GetAlpha() << std::endl
405 else Log() <<
kFATAL <<
"call to SetCC without trainingInfo" <<
Endl;
414 else Log() <<
kFATAL <<
"You asked for Min of the event sample in node for variable " 415 << ivar <<
" that is out of range" <<
Endl;
425 else Log() <<
kFATAL <<
"You asked for Max of the event sample in node for variable " 426 << ivar <<
" that is out of range" <<
Endl;
456 Float_t tempNSigEvents,tempNBkgEvents;
459 if (
gTools().HasAttr(node,
"NCoef")){
476 if(
gTools().HasAttr(node,
"purity") ) {
481 fPurity = tempNSigEvents / (tempNSigEvents + tempNBkgEvents);
540 TTHREAD_TLS_DECL_ARG(
MsgLogger,logger,
"DecisionTreeNode");
Float_t GetRMS(void) 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 decends 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)
DecisionTreeNode(const DecisionTreeNode &n, DecisionTreeNode *parent=NULL)
copy constructor of a node.
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)
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
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 decends 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)
void SetNBkgEvents_unweighted(Float_t b)
Abstract ClassifierFactory template that handles arbitrary types.
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)