ATLAS Offline Software
ForestBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MVAUtils_ForestBase_H
6 #define MVAUtils_ForestBase_H
7 
8 #include <vector>
9 
10 class TTree;
11 class TString;
12 
13 namespace MVAUtils
14 {
22  class IForest
23  {
24  public:
29  virtual float GetTreeResponse(const std::vector<float>& values, unsigned int itree) const = 0;
30  virtual float GetTreeResponse(const std::vector<float*>& pointers, unsigned int itree) const = 0;
32  virtual float GetOffset() const = 0;
34  virtual float GetRawResponse(const std::vector<float>& values) const = 0;
35  virtual float GetRawResponse(const std::vector<float*>& pointers) const = 0;
37  virtual float GetClassification(const std::vector<float>& values) const = 0;
38  virtual float GetClassification(const std::vector<float*>& pointers) const = 0;
40  virtual float GetResponse(const std::vector<float>& values) const = 0;
41  virtual float GetResponse(const std::vector<float*>& pointers) const = 0;
45  virtual std::vector<float> GetMultiResponse(const std::vector<float>& values,
46  unsigned int numClasses) const = 0;
47  virtual std::vector<float> GetMultiResponse(const std::vector<float*>& pointers,
48  unsigned int numClasses) const = 0;
49  virtual unsigned int GetNTrees() const = 0;
50  virtual void PrintForest() const = 0;
51  virtual void PrintTree(unsigned int itree) const = 0;
53  virtual TTree* WriteTree(TString) const = 0;
55  virtual int GetNVars() const = 0;
56  virtual ~IForest()=default;
57  };
58 
59 }
60 #endif
MVAUtils
Definition: InDetTrkInJetType.h:47
MVAUtils::IForest::GetMultiResponse
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).
MVAUtils::IForest::GetResponse
virtual float GetResponse(const std::vector< float * > &pointers) const =0
MVAUtils::IForest::GetNTrees
virtual unsigned int GetNTrees() const =0
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
MVAUtils::IForest::GetMultiResponse
virtual std::vector< float > GetMultiResponse(const std::vector< float * > &pointers, unsigned int numClasses) const =0
MVAUtils::IForest::GetResponse
virtual float GetResponse(const std::vector< float > &values) const =0
Compute the prediction for regression.
MVAUtils::IForest::GetRawResponse
virtual float GetRawResponse(const std::vector< float * > &pointers) const =0
MVAUtils::IForest::GetTreeResponse
virtual float GetTreeResponse(const std::vector< float * > &pointers, unsigned int itree) const =0
MVAUtils::IForest::GetClassification
virtual float GetClassification(const std::vector< float > &values) const =0
Compute the prediction of a classification.
MVAUtils::IForest::WriteTree
virtual TTree * WriteTree(TString) const =0
Return a TTree representing the BDT.
MVAUtils::IForest::PrintTree
virtual void PrintTree(unsigned int itree) const =0
MVAUtils::IForest::GetOffset
virtual float GetOffset() const =0
Return the global offset.
MVAUtils::IForest::GetRawResponse
virtual float GetRawResponse(const std::vector< float > &values) const =0
Return the response of the whole Forest.
MVAUtils::IForest::GetTreeResponse
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 o...
MVAUtils::IForest::~IForest
virtual ~IForest()=default
MVAUtils::IForest
Compute the response from the binary trees in the forest.
Definition: ForestBase.h:23
pointers
std::vector< T * > pointers(std::vector< T > &v)
Definition: rmain.cxx:366
MVAUtils::IForest::GetClassification
virtual float GetClassification(const std::vector< float * > &pointers) const =0
MVAUtils::IForest::GetNVars
virtual int GetNVars() const =0
Get the number of input variable to be passed with std::vector to Get* methods.
MVAUtils::IForest::PrintForest
virtual void PrintForest() const =0