ATLAS Offline Software
Public Member Functions | List of all members
MVAUtils::IForest Class Referenceabstract

Compute the response from the binary trees in the forest. More...

#include <ForestBase.h>

Inheritance diagram for MVAUtils::IForest:
Collaboration diagram for MVAUtils::IForest:

Public Member Functions

virtual float GetTreeResponse (const std::vector< float > &values, unsigned int itree) const =0
 Return the response of one tree Must pass the features in a std::vector<float> values and the index of the tree. More...
 
virtual float GetTreeResponse (const std::vector< float * > &pointers, unsigned int itree) const =0
 
virtual float GetOffset () const =0
 Return the global offset. More...
 
virtual float GetRawResponse (const std::vector< float > &values) const =0
 Return the response of the whole Forest. More...
 
virtual float GetRawResponse (const std::vector< float * > &pointers) const =0
 
virtual float GetClassification (const std::vector< float > &values) const =0
 Compute the prediction of a classification. More...
 
virtual float GetClassification (const std::vector< float * > &pointers) const =0
 
virtual float GetResponse (const std::vector< float > &values) const =0
 Compute the prediction for regression. More...
 
virtual float GetResponse (const std::vector< float * > &pointers) const =0
 
virtual std::vector< float > GetMultiResponse (const std::vector< float > &values, unsigned int numClasses) const =0
 Compute the prediction for multiclassification (a score for each class). More...
 
virtual std::vector< float > GetMultiResponse (const std::vector< float * > &pointers, unsigned int numClasses) const =0
 
virtual unsigned int GetNTrees () const =0
 
virtual void PrintForest () const =0
 
virtual void PrintTree (unsigned int itree) const =0
 
virtual TTree * WriteTree (TString) const =0
 Return a TTree representing the BDT. More...
 
virtual int GetNVars () const =0
 Get the number of input variable to be passed with std::vector to Get* methods. More...
 
virtual ~IForest ()=default
 

Detailed Description

Compute the response from the binary trees in the forest.

Concrete classes should store the trees of the forest with their nodes and be able to compute the response, depending on the implementation. Concrete classes should be constructable from TTree.

Definition at line 22 of file ForestBase.h.

Constructor & Destructor Documentation

◆ ~IForest()

virtual MVAUtils::IForest::~IForest ( )
virtualdefault

Member Function Documentation

◆ GetClassification() [1/2]

virtual float MVAUtils::IForest::GetClassification ( const std::vector< float * > &  pointers) const
pure virtual

◆ GetClassification() [2/2]

virtual float MVAUtils::IForest::GetClassification ( const std::vector< float > &  values) const
pure virtual

◆ GetMultiResponse() [1/2]

virtual std::vector<float> MVAUtils::IForest::GetMultiResponse ( const std::vector< float * > &  pointers,
unsigned int  numClasses 
) const
pure virtual

◆ GetMultiResponse() [2/2]

virtual std::vector<float> MVAUtils::IForest::GetMultiResponse ( const std::vector< float > &  values,
unsigned int  numClasses 
) const
pure virtual

Compute the prediction for multiclassification (a score for each class).

In addition to the input values need to pass the number of classes

Implemented in MVAUtils::Forest< Node_t >, MVAUtils::Forest< NodeTMVA >, MVAUtils::Forest< NodeLGBM >, MVAUtils::Forest< NodeXGBoost >, and MVAUtils::Forest< NodeLGBMSimple >.

◆ GetNTrees()

virtual unsigned int MVAUtils::IForest::GetNTrees ( ) const
pure virtual

Implemented in MVAUtils::Forest< Node_t >.

◆ GetNVars()

virtual int MVAUtils::IForest::GetNVars ( ) const
pure virtual

Get the number of input variable to be passed with std::vector to Get* methods.

Implemented in MVAUtils::ForestTMVA, MVAUtils::ForestLGBM, MVAUtils::ForestXGBoost, and MVAUtils::ForestLGBMSimple.

◆ GetOffset()

virtual float MVAUtils::IForest::GetOffset ( ) const
pure virtual

Return the global offset.

For many implementation this is just 0

Implemented in MVAUtils::Forest< Node_t >, and MVAUtils::ForestWeighted< Node_t >.

◆ GetRawResponse() [1/2]

virtual float MVAUtils::IForest::GetRawResponse ( const std::vector< float * > &  pointers) const
pure virtual

◆ GetRawResponse() [2/2]

virtual float MVAUtils::IForest::GetRawResponse ( const std::vector< float > &  values) const
pure virtual

Return the response of the whole Forest.

Raw is just the sum of all the trees

Implemented in MVAUtils::Forest< Node_t >, MVAUtils::Forest< NodeTMVA >, MVAUtils::Forest< NodeLGBM >, MVAUtils::Forest< NodeXGBoost >, and MVAUtils::Forest< NodeLGBMSimple >.

◆ GetResponse() [1/2]

virtual float MVAUtils::IForest::GetResponse ( const std::vector< float * > &  pointers) const
pure virtual

◆ GetResponse() [2/2]

virtual float MVAUtils::IForest::GetResponse ( const std::vector< float > &  values) const
pure virtual

◆ GetTreeResponse() [1/2]

virtual float MVAUtils::IForest::GetTreeResponse ( const std::vector< float * > &  pointers,
unsigned int  itree 
) const
pure virtual

◆ GetTreeResponse() [2/2]

virtual float MVAUtils::IForest::GetTreeResponse ( const std::vector< float > &  values,
unsigned int  itree 
) const
pure virtual

Return the response of one tree Must pass the features in a std::vector<float> values and the index of the tree.

Implemented in MVAUtils::Forest< Node_t >, MVAUtils::Forest< NodeTMVA >, MVAUtils::Forest< NodeLGBM >, MVAUtils::Forest< NodeXGBoost >, and MVAUtils::Forest< NodeLGBMSimple >.

◆ PrintForest()

virtual void MVAUtils::IForest::PrintForest ( ) const
pure virtual

◆ PrintTree()

virtual void MVAUtils::IForest::PrintTree ( unsigned int  itree) const
pure virtual

◆ WriteTree()

virtual TTree* MVAUtils::IForest::WriteTree ( TString  ) const
pure virtual

Return a TTree representing the BDT.

The called is the owner of the returned TTree

Implemented in MVAUtils::ForestTMVA, MVAUtils::ForestLGBM, MVAUtils::ForestXGBoost, and MVAUtils::ForestLGBMSimple.


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