Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::DecisionTree Class Reference

Implementation of a Decision Tree.

In a decision tree successive decision nodes are used to categorize the events out of the sample as either signal or background. Each node uses only a single discriminating variable to decide if the event is signal-like ("goes right") or background-like ("goes left"). This forms a tree like structure with "baskets" at the end (leave nodes), and an event is classified as either signal or background according to whether the basket where it ends up has been classified signal or background during the training. Training of a decision tree is the process to define the "cut criteria" for each node. The training starts with the root node. Here one takes the full training event sample and selects the variable and corresponding cut value that gives the best separation between signal and background at this stage. Using this cut criterion, the sample is then divided into two subsamples, a signal-like (right) and a background-like (left) sample. Two new nodes are then created for each of the two sub-samples and they are constructed using the same mechanism as described for the root node. The devision is stopped once a certain node has reached either a minimum number of events, or a minimum or maximum signal purity. These leave nodes are then called "signal" or "background" if they contain more signal respective background events from the training sample.

Definition at line 65 of file DecisionTree.h.

Public Types

enum  EPruneMethod { kExpectedErrorPruning =0 , kCostComplexityPruning , kNoPruning }
 
typedef std::vector< const TMVA::Event * > EventConstList
 
typedef std::vector< TMVA::Event * > EventList
 

Public Member Functions

 DecisionTree (const DecisionTree &d)
 copy constructor that creates a true copy, i.e.
 
 DecisionTree (SeparationBase *sepType, Float_t minSize, Int_t nCuts, DataSetInfo *=nullptr, UInt_t cls=0, Bool_t randomisedTree=kFALSE, Int_t useNvars=0, Bool_t usePoissonNvars=kFALSE, UInt_t nMaxDepth=9999999, Int_t iSeed=fgRandomSeed, Float_t purityLimit=0.5, Int_t treeID=0)
 constructor specifying the separation type, the min number of events in a no that is still subjected to further splitting, the number of bins in the grid used in applying the cut for the node splitting.
 
 DecisionTree (void)
 default constructor using the GiniIndex as separation criterion, no restrictions on minium number of events in a leave note or the separation gain in the node splitting
 
virtual ~DecisionTree (void)
 destructor
 
void ApplyValidationSample (const EventConstList *validationSample) const
 run the validation sample through the (pruned) tree and fill in the nodes the variables NSValidation and NBValidadtion (i.e.
 
UInt_t BuildTree (const EventConstList &eventSample, DecisionTreeNode *node=nullptr)
 building the decision tree by recursively calling the splitting of one (root-) node into two daughter nodes (returns the number of nodes)
 
Double_t CheckEvent (const TMVA::Event *, Bool_t UseYesNoLeaf=kFALSE) const
 the event e is put into the decision tree (starting at the root node) and the output is NodeType (signal) or (background) of the final node (basket) in which the given events ends up.
 
void CheckEventWithPrunedTree (const TMVA::Event *) const
 pass a single validation event through a pruned decision tree on the way down the tree, fill in all the "intermediate" information that would normally be there from training.
 
virtual const char * ClassName () const
 
UInt_t CleanTree (DecisionTreeNode *node=nullptr)
 remove those last splits that result in two leaf nodes that are both of the type (i.e.
 
void ClearTree ()
 clear the tree nodes (their S/N, Nevents etc), just keep the structure of the tree
 
UInt_t CountLeafNodes (TMVA::Node *n=nullptr)
 return the number of terminal nodes in the sub-tree below Node n
 
virtual DecisionTreeNodeCreateNode (UInt_t) const
 
virtual BinaryTreeCreateTree () const
 
void DescendTree (Node *n=nullptr)
 descend a tree to find all its leaf nodes
 
Bool_t DoRegression () const
 
void FillEvent (const TMVA::Event &event, TMVA::DecisionTreeNode *node)
 fill the existing the decision tree structure by filling event in from the top node and see where they happen to end up
 
void FillTree (const EventList &eventSample)
 fill the existing the decision tree structure by filling event in from the top node and see where they happen to end up
 
Types::EAnalysisType GetAnalysisType (void)
 
TMVA::DecisionTreeNodeGetEventNode (const TMVA::Event &e) const
 get the pointer to the leaf node where a particular event ends up in... (used in gradient boosting)
 
std::vector< Double_tGetFisherCoefficients (const EventConstList &eventSample, UInt_t nFisherVars, UInt_t *mapVarInFisher)
 calculate the fisher coefficients for the event sample and the variables used
 
Int_t GetNNodesBeforePruning ()
 
NodeGetNode (ULong_t sequence, UInt_t depth)
 retrieve node from the tree.
 
Double_t GetNodePurityLimit () const
 
Double_t GetPruneStrength () const
 
void GetRandomisedVariables (Bool_t *useVariable, UInt_t *variableMap, UInt_t &nVars)
 
virtual DecisionTreeNodeGetRoot () const
 
Double_t GetSumWeights (const EventConstList *validationSample) const
 calculate the normalization factor for a pruning validation sample
 
Int_t GetTreeID ()
 
std::vector< Double_tGetVariableImportance ()
 Return the relative variable importance, normalized to all variables together having the importance 1.
 
Double_t GetVariableImportance (UInt_t ivar)
 returns the relative importance of variable ivar
 
virtual TClassIsA () const
 
void PruneNode (TMVA::DecisionTreeNode *node)
 prune away the subtree below the node
 
void PruneNodeInPlace (TMVA::DecisionTreeNode *node)
 prune a node temporarily (without actually deleting its descendants which allows testing the pruned tree quality for many different pruning stages without "touching" the tree.
 
Double_t PruneTree (const EventConstList *validationSample=nullptr)
 prune (get rid of internal nodes) the Decision tree to avoid overtraining several different pruning methods can be applied as selected by the variable "fPruneMethod".
 
void SetAnalysisType (Types::EAnalysisType t)
 
void SetMinLinCorrForFisher (Double_t min)
 
void SetNodePurityLimit (Double_t p)
 
void SetNVars (Int_t n)
 
void SetParentTreeInNodes (Node *n=nullptr)
 descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time.
 
void SetPruneMethod (EPruneMethod m=kCostComplexityPruning)
 
void SetPruneStrength (Double_t p)
 
void SetTreeID (Int_t treeID)
 
void SetUseExclusiveVars (Bool_t t=kTRUE)
 
void SetUseFisherCuts (Bool_t t=kTRUE)
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
Double_t TestPrunedTreeQuality (const DecisionTreeNode *dt=nullptr, Int_t mode=0) const
 return the misclassification rate of a pruned tree a "pruned tree" may have set the variable "IsTerminal" to "arbitrary" at any node, hence this tree quality testing will stop there, hence test the pruned tree (while the full tree is still in place for normal/later use)
 
Double_t TrainNode (const EventConstList &eventSample, DecisionTreeNode *node)
 
Double_t TrainNodeFast (const EventConstList &eventSample, DecisionTreeNode *node)
 Decide how to split a node using one of the variables that gives the best separation of signal/background.
 
Double_t TrainNodeFull (const EventConstList &eventSample, DecisionTreeNode *node)
 train a node by finding the single optimal cut for a single variable that best separates signal and background (maximizes the separation gain)
 
- Public Member Functions inherited from TMVA::BinaryTree
 BinaryTree (void)
 constructor for a yet "empty" tree. Needs to be filled afterwards
 
virtual ~BinaryTree ()
 destructor (deletes the nodes and "events" if owned by the tree
 
virtual void * AddXMLTo (void *parent) const
 add attributes to XML
 
UInt_t CountNodes (Node *n=nullptr)
 return the number of nodes in the tree. (make a new count --> takes time)
 
NodeGetLeftDaughter (Node *n)
 get left daughter node current node "n"
 
UInt_t GetNNodes () const
 
NodeGetRightDaughter (Node *n)
 get right daughter node current node "n"
 
UInt_t GetTotalTreeDepth () const
 
virtual void Print (std::ostream &os) const
 recursively print the tree
 
virtual void Read (std::istream &istr, UInt_t tmva_Version_Code=262657)
 Read the binary tree from an input stream.
 
virtual void ReadXML (void *node, UInt_t tmva_Version_Code=262657)
 read attributes from XML
 
void SetRoot (Node *r)
 
void SetTotalTreeDepth (Int_t depth)
 
void SetTotalTreeDepth (Node *n=nullptr)
 descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static DecisionTreeCreateFromXML (void *node, UInt_t tmva_Version_Code=262657)
 re-create a new tree (decision tree or search tree) from XML
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TMVA::BinaryTree
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Private Member Functions

Double_t SamplePurity (EventList eventSample)
 calculates the purity S/(S+B) of a given event sample
 

Private Attributes

Types::EAnalysisType fAnalysisType
 kClassification(=0=false) or kRegression(=1=true)
 
DataSetInfofDataSetInfo
 
UInt_t fMaxDepth
 max depth
 
Double_t fMinLinCorrForFisher
 the minimum linear correlation between two variables demanded for use in fisher criterium in node splitting
 
Double_t fMinNodeSize
 min fraction of training events in node
 
Double_t fMinSepGain
 min number of separation gain to perform node splitting
 
Double_t fMinSize
 min number of events in node
 
TRandom3fMyTrandom
 random number generator for randomised trees
 
Int_t fNCuts
 number of grid point in variable cut scans
 
Int_t fNNodesBeforePruning
 remember this one (in case of pruning, it allows to monitor the before/after
 
Double_t fNodePurityLimit
 purity limit to decide whether a node is signal
 
UInt_t fNvars
 number of variables used to separate S and B
 
EPruneMethod fPruneMethod
 method used for pruning
 
Double_t fPruneStrength
 a parameter to set the "amount" of pruning..needs to be adjusted
 
Bool_t fRandomisedTree
 choose at each node splitting a random set of variables
 
RegressionVariancefRegType
 the separation criteria used in Regression
 
SeparationBasefSepType
 the separation criteria
 
UInt_t fSigClass
 class which is treated as signal when building the tree
 
Int_t fTreeID
 just an ID number given to the tree.. makes debugging easier as tree knows who he is.
 
Bool_t fUseExclusiveVars
 individual variables already used in fisher criterium are not anymore analysed individually for node splitting
 
Bool_t fUseFisherCuts
 use multivariate splits using the Fisher criterium
 
Int_t fUseNvars
 the number of variables used in randomised trees;
 
Bool_t fUsePoissonNvars
 use "fUseNvars" not as fixed number but as mean of a poisson distr. in each split
 
Bool_t fUseSearchTree
 cut scan done with binary trees or simple event loop.
 
std::vector< Double_tfVariableImportance
 the relative importance of the different variables
 

Static Private Attributes

static const Int_t fgDebugLevel = 0
 debug level determining some printout/control plots etc.
 
static const Int_t fgRandomSeed = 0
 

Additional Inherited Members

- Protected Member Functions inherited from TMVA::BinaryTree
void DeleteNode (Node *)
 protected, recursive, function used by the class destructor and when Pruning
 
MsgLoggerLog () const
 
- Protected Attributes inherited from TMVA::BinaryTree
UInt_t fDepth
 maximal depth in tree reached
 
UInt_t fNNodes
 total number of nodes in the tree (counted)
 
NodefRoot
 the root node of the tree the tree only has it's root node, the "daughters" are taken care of by the "node" properties of the "root"
 

#include <TMVA/DecisionTree.h>

Inheritance diagram for TMVA::DecisionTree:
[legend]

Member Typedef Documentation

◆ EventConstList

typedef std::vector<const TMVA::Event*> TMVA::DecisionTree::EventConstList

Definition at line 74 of file DecisionTree.h.

◆ EventList

Definition at line 73 of file DecisionTree.h.

Member Enumeration Documentation

◆ EPruneMethod

Enumerator
kExpectedErrorPruning 
kCostComplexityPruning 
kNoPruning 

Definition at line 139 of file DecisionTree.h.

Constructor & Destructor Documentation

◆ DecisionTree() [1/3]

TMVA::DecisionTree::DecisionTree ( void  )

default constructor using the GiniIndex as separation criterion, no restrictions on minium number of events in a leave note or the separation gain in the node splitting

Definition at line 115 of file DecisionTree.cxx.

◆ DecisionTree() [2/3]

TMVA::DecisionTree::DecisionTree ( TMVA::SeparationBase sepType,
Float_t  minSize,
Int_t  nCuts,
DataSetInfo dataInfo = nullptr,
UInt_t  cls = 0,
Bool_t  randomisedTree = kFALSE,
Int_t  useNvars = 0,
Bool_t  usePoissonNvars = kFALSE,
UInt_t  nMaxDepth = 9999999,
Int_t  iSeed = fgRandomSeed,
Float_t  purityLimit = 0.5,
Int_t  treeID = 0 
)

constructor specifying the separation type, the min number of events in a no that is still subjected to further splitting, the number of bins in the grid used in applying the cut for the node splitting.

Definition at line 150 of file DecisionTree.cxx.

◆ DecisionTree() [3/3]

TMVA::DecisionTree::DecisionTree ( const DecisionTree d)

copy constructor that creates a true copy, i.e.

a completely independent tree the node copy will recursively copy all the nodes

Definition at line 200 of file DecisionTree.cxx.

◆ ~DecisionTree()

TMVA::DecisionTree::~DecisionTree ( void  )
virtual

destructor

Definition at line 236 of file DecisionTree.cxx.

Member Function Documentation

◆ ApplyValidationSample()

void TMVA::DecisionTree::ApplyValidationSample ( const EventConstList validationSample) const

run the validation sample through the (pruned) tree and fill in the nodes the variables NSValidation and NBValidadtion (i.e.

how many of the Signal and Background events from the validation sample. This is then later used when asking for the "tree quality" ..

Definition at line 1029 of file DecisionTree.cxx.

◆ BuildTree()

UInt_t TMVA::DecisionTree::BuildTree ( const EventConstList eventSample,
DecisionTreeNode node = nullptr 
)

building the decision tree by recursively calling the splitting of one (root-) node into two daughter nodes (returns the number of nodes)

Definition at line 377 of file DecisionTree.cxx.

◆ CheckEvent()

Double_t TMVA::DecisionTree::CheckEvent ( const TMVA::Event e,
Bool_t  UseYesNoLeaf = kFALSE 
) const

the event e is put into the decision tree (starting at the root node) and the output is NodeType (signal) or (background) of the final node (basket) in which the given events ends up.

I.e. the result of the classification if the event for this decision tree.

Definition at line 2690 of file DecisionTree.cxx.

◆ CheckEventWithPrunedTree()

void TMVA::DecisionTree::CheckEventWithPrunedTree ( const TMVA::Event e) const

pass a single validation event through a pruned decision tree on the way down the tree, fill in all the "intermediate" information that would normally be there from training.

Definition at line 1085 of file DecisionTree.cxx.

◆ Class()

static TClass * TMVA::DecisionTree::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TMVA::DecisionTree::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TMVA::DecisionTree::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 243 of file DecisionTree.h.

◆ ClassName()

virtual const char * TMVA::DecisionTree::ClassName ( ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 98 of file DecisionTree.h.

◆ CleanTree()

UInt_t TMVA::DecisionTree::CleanTree ( DecisionTreeNode node = nullptr)

remove those last splits that result in two leaf nodes that are both of the type (i.e.

both signal or both background) this of course is only a reasonable thing to do when you use "YesOrNo" leafs, while it might loose s.th. if you use the purity information in the nodes. --> hence I don't call it automatically in the tree building

Definition at line 937 of file DecisionTree.cxx.

◆ ClearTree()

void TMVA::DecisionTree::ClearTree ( )

clear the tree nodes (their S/N, Nevents etc), just keep the structure of the tree

Definition at line 923 of file DecisionTree.cxx.

◆ CountLeafNodes()

UInt_t TMVA::DecisionTree::CountLeafNodes ( TMVA::Node n = nullptr)

return the number of terminal nodes in the sub-tree below Node n

Definition at line 1131 of file DecisionTree.cxx.

◆ CreateFromXML()

TMVA::DecisionTree * TMVA::DecisionTree::CreateFromXML ( void *  node,
UInt_t  tmva_Version_Code = 262657 
)
static

re-create a new tree (decision tree or search tree) from XML

Definition at line 281 of file DecisionTree.cxx.

◆ CreateNode()

virtual DecisionTreeNode * TMVA::DecisionTree::CreateNode ( UInt_t  ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 95 of file DecisionTree.h.

◆ CreateTree()

virtual BinaryTree * TMVA::DecisionTree::CreateTree ( ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 96 of file DecisionTree.h.

◆ DeclFileName()

static const char * TMVA::DecisionTree::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 243 of file DecisionTree.h.

◆ DescendTree()

void TMVA::DecisionTree::DescendTree ( Node n = nullptr)

descend a tree to find all its leaf nodes

Definition at line 1160 of file DecisionTree.cxx.

◆ DoRegression()

Bool_t TMVA::DecisionTree::DoRegression ( ) const
inline

Definition at line 188 of file DecisionTree.h.

◆ FillEvent()

void TMVA::DecisionTree::FillEvent ( const TMVA::Event event,
TMVA::DecisionTreeNode node 
)

fill the existing the decision tree structure by filling event in from the top node and see where they happen to end up

Definition at line 891 of file DecisionTree.cxx.

◆ FillTree()

void TMVA::DecisionTree::FillTree ( const EventList eventSample)

fill the existing the decision tree structure by filling event in from the top node and see where they happen to end up

Definition at line 880 of file DecisionTree.cxx.

◆ GetAnalysisType()

Types::EAnalysisType TMVA::DecisionTree::GetAnalysisType ( void  )
inline

Definition at line 190 of file DecisionTree.h.

◆ GetEventNode()

TMVA::DecisionTreeNode * TMVA::DecisionTree::GetEventNode ( const TMVA::Event e) const

get the pointer to the leaf node where a particular event ends up in... (used in gradient boosting)

Definition at line 2673 of file DecisionTree.cxx.

◆ GetFisherCoefficients()

std::vector< Double_t > TMVA::DecisionTree::GetFisherCoefficients ( const EventConstList eventSample,
UInt_t  nFisherVars,
UInt_t mapVarInFisher 
)

calculate the fisher coefficients for the event sample and the variables used

Definition at line 2342 of file DecisionTree.cxx.

◆ GetNNodesBeforePruning()

Int_t TMVA::DecisionTree::GetNNodesBeforePruning ( )
inline

Definition at line 180 of file DecisionTree.h.

◆ GetNode()

TMVA::Node * TMVA::DecisionTree::GetNode ( ULong_t  sequence,
UInt_t  depth 
)

retrieve node from the tree.

Its position (up to a maximal tree depth of 64) is coded as a sequence of left-right moves starting from the root, coded as 0-1 bit patterns stored in the "long-integer" (i.e. 0:left ; 1:right

Definition at line 1231 of file DecisionTree.cxx.

◆ GetNodePurityLimit()

Double_t TMVA::DecisionTree::GetNodePurityLimit ( ) const
inline

Definition at line 162 of file DecisionTree.h.

◆ GetPruneStrength()

Double_t TMVA::DecisionTree::GetPruneStrength ( ) const
inline

Definition at line 147 of file DecisionTree.h.

◆ GetRandomisedVariables()

void TMVA::DecisionTree::GetRandomisedVariables ( Bool_t useVariable,
UInt_t variableMap,
UInt_t nVars 
)

Definition at line 1247 of file DecisionTree.cxx.

◆ GetRoot()

virtual DecisionTreeNode * TMVA::DecisionTree::GetRoot ( ) const
inlinevirtual

Reimplemented from TMVA::BinaryTree.

Definition at line 94 of file DecisionTree.h.

◆ GetSumWeights()

Double_t TMVA::DecisionTree::GetSumWeights ( const EventConstList validationSample) const

calculate the normalization factor for a pruning validation sample

Definition at line 1118 of file DecisionTree.cxx.

◆ GetTreeID()

Int_t TMVA::DecisionTree::GetTreeID ( )
inline

Definition at line 186 of file DecisionTree.h.

◆ GetVariableImportance() [1/2]

vector< Double_t > TMVA::DecisionTree::GetVariableImportance ( )

Return the relative variable importance, normalized to all variables together having the importance 1.

The importance in evaluated as the total separation-gain that this variable had in the decision trees (weighted by the number of events)

Definition at line 2745 of file DecisionTree.cxx.

◆ GetVariableImportance() [2/2]

Double_t TMVA::DecisionTree::GetVariableImportance ( UInt_t  ivar)

returns the relative importance of variable ivar

Definition at line 2766 of file DecisionTree.cxx.

◆ IsA()

virtual TClass * TMVA::DecisionTree::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Reimplemented from TMVA::BinaryTree.

Definition at line 243 of file DecisionTree.h.

◆ PruneNode()

void TMVA::DecisionTree::PruneNode ( TMVA::DecisionTreeNode node)

prune away the subtree below the node

Definition at line 1194 of file DecisionTree.cxx.

◆ PruneNodeInPlace()

void TMVA::DecisionTree::PruneNodeInPlace ( TMVA::DecisionTreeNode node)

prune a node temporarily (without actually deleting its descendants which allows testing the pruned tree quality for many different pruning stages without "touching" the tree.

Definition at line 1217 of file DecisionTree.cxx.

◆ PruneTree()

Double_t TMVA::DecisionTree::PruneTree ( const EventConstList validationSample = nullptr)

prune (get rid of internal nodes) the Decision tree to avoid overtraining several different pruning methods can be applied as selected by the variable "fPruneMethod".

Definition at line 964 of file DecisionTree.cxx.

◆ SamplePurity()

Double_t TMVA::DecisionTree::SamplePurity ( EventList  eventSample)
private

calculates the purity S/(S+B) of a given event sample

Definition at line 2722 of file DecisionTree.cxx.

◆ SetAnalysisType()

void TMVA::DecisionTree::SetAnalysisType ( Types::EAnalysisType  t)
inline

Definition at line 189 of file DecisionTree.h.

◆ SetMinLinCorrForFisher()

void TMVA::DecisionTree::SetMinLinCorrForFisher ( Double_t  min)
inline

Definition at line 192 of file DecisionTree.h.

◆ SetNodePurityLimit()

void TMVA::DecisionTree::SetNodePurityLimit ( Double_t  p)
inline

Definition at line 161 of file DecisionTree.h.

◆ SetNVars()

void TMVA::DecisionTree::SetNVars ( Int_t  n)
inline

Definition at line 194 of file DecisionTree.h.

◆ SetParentTreeInNodes()

void TMVA::DecisionTree::SetParentTreeInNodes ( Node n = nullptr)

descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time.

Definition at line 248 of file DecisionTree.cxx.

◆ SetPruneMethod()

void TMVA::DecisionTree::SetPruneMethod ( EPruneMethod  m = kCostComplexityPruning)
inline

Definition at line 140 of file DecisionTree.h.

◆ SetPruneStrength()

void TMVA::DecisionTree::SetPruneStrength ( Double_t  p)
inline

Definition at line 146 of file DecisionTree.h.

◆ SetTreeID()

void TMVA::DecisionTree::SetTreeID ( Int_t  treeID)
inline

Definition at line 185 of file DecisionTree.h.

◆ SetUseExclusiveVars()

void TMVA::DecisionTree::SetUseExclusiveVars ( Bool_t  t = kTRUE)
inline

Definition at line 193 of file DecisionTree.h.

◆ SetUseFisherCuts()

void TMVA::DecisionTree::SetUseFisherCuts ( Bool_t  t = kTRUE)
inline

Definition at line 191 of file DecisionTree.h.

◆ Streamer()

virtual void TMVA::DecisionTree::Streamer ( TBuffer )
virtual

Reimplemented from TMVA::BinaryTree.

◆ StreamerNVirtual()

void TMVA::DecisionTree::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 243 of file DecisionTree.h.

◆ TestPrunedTreeQuality()

Double_t TMVA::DecisionTree::TestPrunedTreeQuality ( const DecisionTreeNode dt = nullptr,
Int_t  mode = 0 
) const

return the misclassification rate of a pruned tree a "pruned tree" may have set the variable "IsTerminal" to "arbitrary" at any node, hence this tree quality testing will stop there, hence test the pruned tree (while the full tree is still in place for normal/later use)

Definition at line 1043 of file DecisionTree.cxx.

◆ TrainNode()

Double_t TMVA::DecisionTree::TrainNode ( const EventConstList eventSample,
DecisionTreeNode node 
)
inline

Definition at line 108 of file DecisionTree.h.

◆ TrainNodeFast()

Double_t TMVA::DecisionTree::TrainNodeFast ( const EventConstList eventSample,
TMVA::DecisionTreeNode node 
)

Decide how to split a node using one of the variables that gives the best separation of signal/background.

In order to do this, for each variable a scan of the different cut values in a grid (grid = fNCuts) is performed and the resulting separation gains are compared. in addition to the individual variables, one can also ask for a fisher discriminant being built out of (some) of the variables and used as a possible multivariate split.

Definition at line 1374 of file DecisionTree.cxx.

◆ TrainNodeFull()

Double_t TMVA::DecisionTree::TrainNodeFull ( const EventConstList eventSample,
TMVA::DecisionTreeNode node 
)

train a node by finding the single optimal cut for a single variable that best separates signal and background (maximizes the separation gain)

Definition at line 2536 of file DecisionTree.cxx.

Member Data Documentation

◆ fAnalysisType

Types::EAnalysisType TMVA::DecisionTree::fAnalysisType
private

kClassification(=0=false) or kRegression(=1=true)

Definition at line 239 of file DecisionTree.h.

◆ fDataSetInfo

DataSetInfo* TMVA::DecisionTree::fDataSetInfo
private

Definition at line 241 of file DecisionTree.h.

◆ fgDebugLevel

const Int_t TMVA::DecisionTree::fgDebugLevel = 0
staticprivate

debug level determining some printout/control plots etc.

Definition at line 236 of file DecisionTree.h.

◆ fgRandomSeed

const Int_t TMVA::DecisionTree::fgRandomSeed = 0
staticprivate

Definition at line 69 of file DecisionTree.h.

◆ fMaxDepth

UInt_t TMVA::DecisionTree::fMaxDepth
private

max depth

Definition at line 234 of file DecisionTree.h.

◆ fMinLinCorrForFisher

Double_t TMVA::DecisionTree::fMinLinCorrForFisher
private

the minimum linear correlation between two variables demanded for use in fisher criterium in node splitting

Definition at line 208 of file DecisionTree.h.

◆ fMinNodeSize

Double_t TMVA::DecisionTree::fMinNodeSize
private

min fraction of training events in node

Definition at line 215 of file DecisionTree.h.

◆ fMinSepGain

Double_t TMVA::DecisionTree::fMinSepGain
private

min number of separation gain to perform node splitting

Definition at line 216 of file DecisionTree.h.

◆ fMinSize

Double_t TMVA::DecisionTree::fMinSize
private

min number of events in node

Definition at line 214 of file DecisionTree.h.

◆ fMyTrandom

TRandom3* TMVA::DecisionTree::fMyTrandom
private

random number generator for randomised trees

Definition at line 230 of file DecisionTree.h.

◆ fNCuts

Int_t TMVA::DecisionTree::fNCuts
private

number of grid point in variable cut scans

Definition at line 206 of file DecisionTree.h.

◆ fNNodesBeforePruning

Int_t TMVA::DecisionTree::fNNodesBeforePruning
private

remember this one (in case of pruning, it allows to monitor the before/after

Definition at line 222 of file DecisionTree.h.

◆ fNodePurityLimit

Double_t TMVA::DecisionTree::fNodePurityLimit
private

purity limit to decide whether a node is signal

Definition at line 224 of file DecisionTree.h.

◆ fNvars

UInt_t TMVA::DecisionTree::fNvars
private

number of variables used to separate S and B

Definition at line 205 of file DecisionTree.h.

◆ fPruneMethod

EPruneMethod TMVA::DecisionTree::fPruneMethod
private

method used for pruning

Definition at line 221 of file DecisionTree.h.

◆ fPruneStrength

Double_t TMVA::DecisionTree::fPruneStrength
private

a parameter to set the "amount" of pruning..needs to be adjusted

Definition at line 219 of file DecisionTree.h.

◆ fRandomisedTree

Bool_t TMVA::DecisionTree::fRandomisedTree
private

choose at each node splitting a random set of variables

Definition at line 226 of file DecisionTree.h.

◆ fRegType

RegressionVariance* TMVA::DecisionTree::fRegType
private

the separation criteria used in Regression

Definition at line 212 of file DecisionTree.h.

◆ fSepType

SeparationBase* TMVA::DecisionTree::fSepType
private

the separation criteria

Definition at line 211 of file DecisionTree.h.

◆ fSigClass

UInt_t TMVA::DecisionTree::fSigClass
private

class which is treated as signal when building the tree

Definition at line 235 of file DecisionTree.h.

◆ fTreeID

Int_t TMVA::DecisionTree::fTreeID
private

just an ID number given to the tree.. makes debugging easier as tree knows who he is.

Definition at line 237 of file DecisionTree.h.

◆ fUseExclusiveVars

Bool_t TMVA::DecisionTree::fUseExclusiveVars
private

individual variables already used in fisher criterium are not anymore analysed individually for node splitting

Definition at line 209 of file DecisionTree.h.

◆ fUseFisherCuts

Bool_t TMVA::DecisionTree::fUseFisherCuts
private

use multivariate splits using the Fisher criterium

Definition at line 207 of file DecisionTree.h.

◆ fUseNvars

Int_t TMVA::DecisionTree::fUseNvars
private

the number of variables used in randomised trees;

Definition at line 227 of file DecisionTree.h.

◆ fUsePoissonNvars

Bool_t TMVA::DecisionTree::fUsePoissonNvars
private

use "fUseNvars" not as fixed number but as mean of a poisson distr. in each split

Definition at line 228 of file DecisionTree.h.

◆ fUseSearchTree

Bool_t TMVA::DecisionTree::fUseSearchTree
private

cut scan done with binary trees or simple event loop.

Definition at line 218 of file DecisionTree.h.

◆ fVariableImportance

std::vector< Double_t > TMVA::DecisionTree::fVariableImportance
private

the relative importance of the different variables

Definition at line 232 of file DecisionTree.h.

Libraries for TMVA::DecisionTree:

The documentation for this class was generated from the following files: