32 #ifndef ROOT_TMVA_DecisionTree 33 #define ROOT_TMVA_DecisionTree 47 #ifndef ROOT_TMVA_Types 50 #ifndef ROOT_TMVA_DecisionTreeNode 53 #ifndef ROOT_TMVA_BinaryTree 56 #ifndef ROOT_TMVA_BinarySearchTree 59 #ifndef ROOT_TMVA_SeparationBase 62 #ifndef ROOT_TMVA_RegressionVariance 106 virtual const char*
ClassName()
const {
return "DecisionTree"; }
125 void FillTree(
const EventList & eventSample);
void SetPruneMethod(EPruneMethod m=kCostComplexityPruning)
DataSetInfo * fDataSetInfo
virtual BinaryTree * CreateTree() const
Random number generator class based on M.
#define TMVA_VERSION_CODE
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 (sig...
Int_t fNNodesBeforePruning
Double_t GetNodePurityLimit() const
EPruneMethod fPruneMethod
Types::EAnalysisType GetAnalysisType(void)
std::vector< Double_t > GetFisherCoefficients(const EventConstList &eventSample, UInt_t nFisherVars, UInt_t *mapVarInFisher)
calculate the fisher coefficients for the event sample and the variables used
void SetUseExclusiveVars(Bool_t t=kTRUE)
Double_t fNodePurityLimit
virtual ~DecisionTree(void)
destructor
Double_t TestPrunedTreeQuality(const DecisionTreeNode *dt=NULL, Int_t mode=0) const
return the misclassification rate of a pruned tree a "pruned tree" may have set the variable "IsTermi...
virtual DecisionTreeNode * GetRoot() const
void CheckEventWithPrunedTree(const TMVA::Event *) const
pass a single validation event throught a pruned decision tree on the way down the tree...
void SetNodePurityLimit(Double_t p)
std::vector< Double_t > GetVariableImportance()
Return the relative variable importance, normalized to all variables together having the importance 1...
void SetAnalysisType(Types::EAnalysisType t)
std::vector< const TMVA::Event * > EventConstList
#define ClassDef(name, id)
static const Int_t fgRandomSeed
void FillTree(const EventList &eventSample)
Double_t SamplePurity(EventList eventSample)
calculates the purity S/(S+B) of a given event sample
std::vector< Double_t > fVariableImportance
Double_t GetSumWeights(const EventConstList *validationSample) const
calculate the normalization factor for a pruning validation sample
void SetTreeID(Int_t treeID)
UInt_t CountLeafNodes(TMVA::Node *n=NULL)
return the number of terminal nodes in the sub-tree below Node n
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/backgr...
void DescendTree(Node *n=NULL)
descend a tree to find all its leaf nodes
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 the...
Bool_t DoRegression() const
Double_t fMinLinCorrForFisher
void SetMinLinCorrForFisher(Double_t min)
UInt_t CleanTree(DecisionTreeNode *node=NULL)
remove those last splits that result in two leaf nodes that are both of the type (i.e.
virtual DecisionTreeNode * CreateNode(UInt_t) const
Int_t GetNNodesBeforePruning()
void SetPruneStrength(Double_t p)
void GetRandomisedVariables(Bool_t *useVariable, UInt_t *variableMap, UInt_t &nVars)
Double_t TrainNodeFull(const EventConstList &eventSample, DecisionTreeNode *node)
void SetParentTreeInNodes(Node *n=NULL)
descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time...
void PruneNodeInPlace(TMVA::DecisionTreeNode *node)
prune a node temporaily (without actually deleting its decendants which allows testing the pruned tre...
TMVA::DecisionTreeNode * GetEventNode(const TMVA::Event &e) const
get the pointer to the leaf node where a particular event ends up in...
std::vector< TMVA::Event * > EventList
void SetUseFisherCuts(Bool_t t=kTRUE)
void ApplyValidationSample(const EventConstList *validationSample) const
run the validation sample through the (pruned) tree and fill in the nodes the variables NSValidation ...
Node * GetNode(ULong_t sequence, UInt_t depth)
retrieve node from the tree.
static const Int_t fgDebugLevel
void ClearTree()
clear the tree nodes (their S/N, Nevents etc), just keep the structure of the tree ...
Types::EAnalysisType fAnalysisType
static DecisionTree * CreateFromXML(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
re-create a new tree (decision tree or search tree) from XML
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
RegressionVariance * fRegType
SeparationBase * fSepType
Double_t PruneTree(const EventConstList *validationSample=NULL)
prune (get rid of internal nodes) the Decision tree to avoid overtraining serveral different pruning ...
Abstract ClassifierFactory template that handles arbitrary types.
UInt_t BuildTree(const EventConstList &eventSample, DecisionTreeNode *node=NULL)
building the decision tree by recursively calling the splitting of one (root-) node into two daughter...
Double_t GetPruneStrength() const
virtual const char * ClassName() const
Double_t TrainNode(const EventConstList &eventSample, DecisionTreeNode *node)
void PruneNode(TMVA::DecisionTreeNode *node)
prune away the subtree below the node