ROOT logo
ROOT » TMVA » TMVA::DecisionTreeNode

class TMVA::DecisionTreeNode: public TMVA::Node


 Node for the Decision Tree

 The node specifies ONE variable out of the given set of selection variable
 that is used to split the sample which "arrives" at the node, into a left
 (background-enhanced) and a right (signal-enhanced) sample.

Function Members (Methods)

public:
virtual~DecisionTreeNode()
virtual voidAddAttributesToNode(void* node) const
virtual voidTMVA::Node::AddAttributesToNode(void* node) const
virtual voidAddContentToNode(stringstream& s) const
virtual voidTMVA::Node::AddContentToNode(stringstream& s) const
voidAddToSumTarget(Float_t t)
voidAddToSumTarget2(Float_t t2)
void*TMVA::Node::AddXMLTo(void* parent) const
static TClass*Class()
static TClass*TMVA::Node::Class()
voidClearNodeAndAllDaughters()
Int_tTMVA::Node::CountMeAndAllDaughters() const
virtual TMVA::Node*CreateNode() const
virtual TMVA::Node*TMVA::Node::CreateNode() const
TMVA::DecisionTreeNodeDecisionTreeNode()
TMVA::DecisionTreeNodeDecisionTreeNode(TMVA::Node* p, char pos)
TMVA::DecisionTreeNodeDecisionTreeNode(const TMVA::DecisionTreeNode& n, TMVA::DecisionTreeNode* parent = NULL)
Double_tGetAlpha() const
Double_tGetAlphaMinSubtree() const
Double_tGetCC() const
intTMVA::Node::GetCount()
Bool_tGetCutType() const
Float_tGetCutValue() const
UInt_tTMVA::Node::GetDepth() const
TMVA::Node*TMVA::Node::GetLeft() const
TMVA::DecisionTreeNode*GetLeftDaughter()
const TMVA::DecisionTreeNode*GetLeftDaughter() const
TMVA::DecisionTreeNode*GetMother()
const TMVA::DecisionTreeNode*GetMother() const
Float_tGetNBkgEvents() const
Float_tGetNBkgEvents_unweighted() const
Double_tGetNBValidation() const
Float_tGetNEvents() const
Float_tGetNEvents_unweighted() const
Double_tGetNodeR() const
Int_tGetNodeType() const
Float_tGetNSigEvents() const
Float_tGetNSigEvents_unweighted() const
Double_tGetNSValidation() const
Int_tGetNTerminal() const
TMVA::Node*TMVA::Node::GetParent() const
TMVA::BinaryTree*TMVA::Node::GetParentTree() const
charTMVA::Node::GetPos() const
Float_tGetPurity() const
Float_tGetResponse() const
TMVA::Node*TMVA::Node::GetRight() const
TMVA::DecisionTreeNode*GetRightDaughter()
const TMVA::DecisionTreeNode*GetRightDaughter() const
Float_tGetRMS() const
Float_tGetSampleMax(UInt_t ivar) const
Float_tGetSampleMin(UInt_t ivar) const
Short_tGetSelector() const
Float_tGetSeparationGain() const
Float_tGetSeparationIndex() const
ULong_tGetSequence() const
Double_tGetSubTreeR() const
Float_tGetSumTarget() const
Float_tGetSumTarget2() const
virtual Bool_tGoesLeft(const TMVA::Event&) const
virtual Bool_tTMVA::Node::GoesLeft(const TMVA::Event&) const
virtual Bool_tGoesRight(const TMVA::Event&) const
virtual Bool_tTMVA::Node::GoesRight(const TMVA::Event&) const
voidIncrementNBkgEvents(Float_t b)
voidIncrementNBkgEvents_unweighted()
voidIncrementNEvents(Float_t nev)
voidIncrementNEvents_unweighted()
voidIncrementNSigEvents(Float_t s)
voidIncrementNSigEvents_unweighted()
virtual TClass*IsA() const
virtual TClass*TMVA::Node::IsA() const
Bool_tIsTerminal() const
TMVA::DecisionTreeNode&operator=(const TMVA::DecisionTreeNode&)
TMVA::Node&TMVA::Node::operator=(const TMVA::Node&)
virtual voidPrint(ostream& os) const
virtual voidTMVA::Node::Print(ostream& os) const
voidPrintPrune(ostream& os) const
virtual voidPrintRec(ostream& os) const
virtual voidTMVA::Node::PrintRec(ostream& os) const
voidPrintRecPrune(ostream& os) const
virtual voidTMVA::Node::ReadAttributes(void* node)
virtual voidTMVA::Node::ReadContent(stringstream& s)
virtual Bool_tTMVA::Node::ReadDataRecord(istream&)
voidTMVA::Node::ReadXML(void* node)
voidResetValidationData()
voidSetAlpha(Double_t alpha)
voidSetAlphaMinSubtree(Double_t g)
voidSetCC(Double_t cc)
voidSetCutType(Bool_t t)
voidSetCutValue(Float_t c)
voidTMVA::Node::SetDepth(UInt_t d)
voidTMVA::Node::SetLeft(TMVA::Node* l)
voidSetNBkgEvents(Float_t b)
voidSetNBkgEvents_unweighted(Float_t b)
voidSetNBValidation(Double_t b)
voidSetNEvents(Float_t nev)
voidSetNEvents_unweighted(Float_t nev)
voidSetNodeR(Double_t r)
voidSetNodeType(Int_t t)
voidSetNSigEvents(Float_t s)
voidSetNSigEvents_unweighted(Float_t s)
voidSetNSValidation(Double_t s)
voidSetNTerminal(Int_t n)
voidTMVA::Node::SetParent(TMVA::Node* p)
voidTMVA::Node::SetParentTree(TMVA::BinaryTree* t)
voidTMVA::Node::SetPos(char s)
voidSetResponse(Float_t r)
voidTMVA::Node::SetRight(TMVA::Node* r)
voidSetRMS(Float_t r)
voidSetSampleMax(UInt_t ivar, Float_t xmax)
voidSetSampleMin(UInt_t ivar, Float_t xmin)
voidSetSelector(Short_t i)
voidSetSeparationGain(Float_t sep)
voidSetSeparationIndex(Float_t sep)
voidSetSequence(ULong_t s)
voidSetSubTreeR(Double_t r)
voidSetSumTarget(Float_t t)
voidSetSumTarget2(Float_t t2)
voidSetTerminal(Bool_t s = kTRUE)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidTMVA::Node::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
virtual voidTMVA::Node::Streamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidTMVA::Node::StreamerNVirtual(TBuffer& b)
private:
virtual voidReadAttributes(void* node)
virtual voidReadContent(stringstream& s)
virtual Bool_tReadDataRecord(istream& is)

Data Members

private:
Double_tfAlphacritical alpha for this node
Double_tfCCdebug variable for cost complexity pruing .. temporary bla
Bool_tfCutTypetrue: if event variable > cutValue ==> signal , false otherwise
Float_tfCutValuecut value appplied on this node to discriminate bkg against sig
Double_tfGminimum alpha in subtree rooted at this node
Bool_tfIsTerminalNode! flag to set node as terminal (i.e., without deleting its descendants)
Double_tfNBsum of weights of background events from the pruning sample in this node
Float_tfNBkgEventssum of weights of backgr event in the node
Float_tfNBkgEvents_unweightedsum of backgr event in the node
Float_tfNEventsnumber of events in that entered the node (during training)
Float_tfNEvents_unweightednumber of events in that entered the node (during training)
Double_tfNSditto for the signal events
Float_tfNSigEventssum of weights of signal event in the node
Float_tfNSigEvents_unweightedsum of signal event in the node
Int_tfNTerminalnumber of terminal nodes in subtree rooted at this node
Double_tfNodeRnode resubstitution estimate, R(t)
Int_tfNodeTypeType of node: -1 == Bkg-leaf, 1 == Signal-leaf, 0 = internal
Float_tfRMSresponse RMS of the regression node
Float_tfResponseresponse value in case of regression
vector<Float_t>fSampleMaxthe maxima for each ivar of the sample on the node during training
vector<Float_t>fSampleMinthe minima for each ivar of the sample on the node during training
Short_tfSelectorindex of variable used in node selection (decision tree)
Float_tfSeparationGainmeasure of "purity", separation, or information gained BY this nodes selection
Float_tfSeparationIndexmeasure of "purity" (separation between S and B) AT this node
ULong_tfSequencebit coded left right sequence to reach the node
Double_tfSubTreeRR(T) = Sum(R(t) : t in ~T)
Float_tfSumTargetsum of weight*target used for the calculatio of the variance (regression)
Float_tfSumTarget2sum of weight*target^2 used for the calculatio of the variance (regression)
static TMVA::MsgLogger*fgLoggerstatic because there is a huge number of nodes...

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

DecisionTreeNode()
 constructor of an essentially "empty" node floating in space
DecisionTreeNode(TMVA::Node* p, char pos)
 constructor of a daughter node as a daughter of 'p'
DecisionTreeNode(const TMVA::DecisionTreeNode &n, DecisionTreeNode* parent)
 copy constructor of a node. It will result in an explicit copy of
 the node and recursively all it's daughters
Bool_t GoesRight(const TMVA::Event& ) const
 test event if it decends the tree at this node to the right
Bool_t GoesLeft(const TMVA::Event& ) const
 test event if it decends the tree at this node to the left
Float_t GetPurity( void )
 return the S/(S+B) (purity) for the node
 REM: even if nodes with purity 0.01 are very PURE background nodes, they still
      get a small value of the purity.
void Print(ostream& os) const
print the node
void PrintRec(ostream& os) const
recursively print the node and its daughters (--> print the 'tree')
Bool_t ReadDataRecord(istream& is)
 Read the data block
void ClearNodeAndAllDaughters()
 clear the nodes (their S/N, Nevents etc), just keep the structure of the tree
void ResetValidationData()
 temporary stored node values (number of events, etc.) that originate
 not from the training but from the validation data (used in pruning)
void PrintPrune(ostream& os) const
 printout of the node (can be read in with ReadDataRecord)
void PrintRecPrune(ostream& os) const
 recursive printout of the node and its daughters
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 GetSampleMax(UInt_t ivar) const
 return the maximum of variable ivar from the training sample
 that pass/end up in this node
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 SetSampleMax(UInt_t ivar, Float_t xmax)
 set the maximum of variable ivar from the training sample
 that pass/end up in this node
void ReadAttributes(void* node)
 read attribute from xml
void AddAttributesToNode(void* node) const
 add attribute to xml
void AddContentToNode(stringstream& s) const
 adding attributes to tree node  (well, was used in BinarySearchTree,
 and somehow I guess someone programmed it such that we need this in
 this tree too, although we don't..)
void ReadContent(stringstream& s)
 reading attributes from tree node  (well, was used in BinarySearchTree,
 and somehow I guess someone programmed it such that we need this in
 this tree too, although we don't..)
virtual ~DecisionTreeNode()
{}
Node* CreateNode() const
{ return new DecisionTreeNode(); }
void SetSelector(Short_t i)
 set index of variable used for discrimination at this node
{ fSelector = i; }
Short_t GetSelector() const
{ return fSelector; }
void SetCutValue(Float_t c)
 set the cut value applied at this node
{ fCutValue = c; }
Float_t GetCutValue( void )
{ return fCutValue; }
void SetCutType(Bool_t t)
 set true: if event variable > cutValue ==> signal , false otherwise
{ fCutType = t; }
Bool_t GetCutType( void )
{ return fCutType; }
void SetNodeType(Int_t t)
 set node type: 1 signal node, -1 bkg leave, 0 intermediate Node
{ fNodeType = t;}
Int_t GetNodeType( void )
{ return fNodeType; }
void SetResponse(Float_t r)
set the response of the node (for regression)
{ fResponse = r;}
Float_t GetResponse( void )
return the response of the node (for regression)
{ return fResponse;}
void SetRMS(Float_t r)
set the RMS of the response of the node (for regression)
{ fRMS = r;}
Float_t GetRMS( void )
return the RMS of the response of the node (for regression)
{ return fRMS;}
void SetNSigEvents(Float_t s)
 set the sum of the signal weights in the node
{ fNSigEvents = s; }
void SetNBkgEvents(Float_t b)
 set the sum of the backgr weights in the node
{ fNBkgEvents = b; }
void SetNEvents(Float_t nev)
 set the number of events that entered the node (during training)
{ fNEvents =nev ; }
void SetNSigEvents_unweighted(Float_t s)
 set the sum of the unweighted signal events in the node
void SetNBkgEvents_unweighted(Float_t b)
 set the sum of the unweighted backgr events in the node
void SetNEvents_unweighted(Float_t nev)
 set the number of unweighted events that entered the node (during training)
void IncrementNSigEvents(Float_t s)
 increment the sum of the signal weights in the node
{ fNSigEvents += s; }
void IncrementNBkgEvents(Float_t b)
 increment the sum of the backgr weights in the node
{ fNBkgEvents += b; }
void IncrementNEvents(Float_t nev)
 increment the number of events that entered the node (during training)
{ fNEvents +=nev ; }
void IncrementNSigEvents_unweighted()
 increment the sum of the signal weights in the node
void IncrementNBkgEvents_unweighted()
 increment the sum of the backgr weights in the node
void IncrementNEvents_unweighted()
 increment the number of events that entered the node (during training)
Float_t GetNSigEvents( void )
 return the sum of the signal weights in the node
{ return fNSigEvents; }
Float_t GetNBkgEvents( void )
 return the sum of the backgr weights in the node
{ return fNBkgEvents; }
Float_t GetNEvents( void )
 return  the number of events that entered the node (during training)
{ return fNEvents; }
Float_t GetNSigEvents_unweighted( void )
 return the sum of unweighted signal weights in the node
Float_t GetNBkgEvents_unweighted( void )
 return the sum of unweighted backgr weights in the node
Float_t GetNEvents_unweighted( void )
 return  the number of unweighted events that entered the node (during training)
void SetSeparationIndex(Float_t sep)
 set the choosen index, measure of "purity" (separation between S and B) AT this node
{ fSeparationIndex =sep ; }
Float_t GetSeparationIndex( void )
{ return fSeparationIndex; }
void SetSeparationGain(Float_t sep)
 set the separation, or information gained BY this nodes selection
{ fSeparationGain =sep ; }
Float_t GetSeparationGain( void )
{ return fSeparationGain; }
DecisionTreeNode* GetLeftDaughter( )
 get pointers to children, mother in the tree
{ return dynamic_cast<DecisionTreeNode*>(GetLeft()); }
DecisionTreeNode* GetRightDaughter( )
{ return dynamic_cast<DecisionTreeNode*>(GetRight()); }
DecisionTreeNode* GetMother( )
{ return dynamic_cast<DecisionTreeNode*>(GetParent()); }
const DecisionTreeNode* GetLeftDaughter( )
{ return dynamic_cast<DecisionTreeNode*>(GetLeft()); }
const DecisionTreeNode* GetRightDaughter( )
{ return dynamic_cast<DecisionTreeNode*>(GetRight()); }
const DecisionTreeNode* GetMother( )
{ return dynamic_cast<DecisionTreeNode*>(GetParent()); }
ULong_t GetSequence() const
{return fSequence;}
void SetSequence(ULong_t s)
void SetNodeR(Double_t r)
 the node resubstitution estimate, R(t), for Cost Complexity pruning
{ fNodeR = r; }
Double_t GetNodeR() const
{ return fNodeR; }
void SetSubTreeR(Double_t r)
 the resubstitution estimate, R(T_t), of the tree rooted at this node
{ fSubTreeR = r; }
Double_t GetSubTreeR() const
{ return fSubTreeR; }
void SetAlpha(Double_t alpha)
                             R(t) - R(T_t)
 the critical point alpha =  -------------
                              |~T_t| - 1
{ fAlpha = alpha; }
Double_t GetAlpha() const
{ return fAlpha; }
void SetAlphaMinSubtree(Double_t g)
 the minimum alpha in the tree rooted at this node
{ fG = g; }
Double_t GetAlphaMinSubtree() const
{ return fG; }
void SetNTerminal(Int_t n)
 number of terminal nodes in the subtree rooted here
{ fNTerminal = n; }
Int_t GetNTerminal() const
{ return fNTerminal; }
void SetNBValidation(Double_t b)
 number of background/signal events from the pruning validation sample
{ fNB = b; }
void SetNSValidation(Double_t s)
{ fNS = s; }
Double_t GetNBValidation() const
{ return fNB; }
Double_t GetNSValidation() const
{ return fNS; }
void SetSumTarget(Float_t t)
{fSumTarget = t; }
void SetSumTarget2(Float_t t2)
{fSumTarget2 = t2; }
void AddToSumTarget(Float_t t)
{fSumTarget += t; }
void AddToSumTarget2(Float_t t2)
{fSumTarget2 += t2; }
Float_t GetSumTarget() const
{return fSumTarget; }
Float_t GetSumTarget2() const
{return fSumTarget2; }
Bool_t IsTerminal() const
 flag indicates whether this node is terminal
{ return fIsTerminalNode; }
void SetTerminal(Bool_t s = kTRUE)
void SetCC(Double_t cc)
{fCC = cc;}
Double_t GetCC() const
{return fCC;}