ATLAS Offline Software
Loading...
Searching...
No Matches
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
10class TTree;
11class TString;
12
13namespace MVAUtils
14{
21
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
Compute the response from the binary trees in the forest.
Definition ForestBase.h:23
virtual std::vector< float > GetMultiResponse(const std::vector< float * > &pointers, unsigned int numClasses) const =0
virtual TTree * WriteTree(TString) const =0
Return a TTree representing the BDT.
virtual float GetClassification(const std::vector< float * > &pointers) const =0
virtual ~IForest()=default
virtual void PrintTree(unsigned int itree) 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).
virtual unsigned int GetNTrees() const =0
virtual float GetTreeResponse(const std::vector< float * > &pointers, unsigned int itree) const =0
virtual float GetOffset() const =0
Return the global offset.
virtual float GetRawResponse(const std::vector< float > &values) const =0
Return the response of the whole Forest.
virtual float GetClassification(const std::vector< float > &values) const =0
Compute the prediction of a classification.
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...
virtual void PrintForest() const =0
virtual float GetResponse(const std::vector< float > &values) const =0
Compute the prediction for regression.
virtual float GetRawResponse(const std::vector< float * > &pointers) const =0
virtual float GetResponse(const std::vector< float * > &pointers) const =0
virtual int GetNVars() const =0
Get the number of input variable to be passed with std::vector to Get* methods.
std::vector< T * > pointers(std::vector< T > &v)
Definition rmain.cxx:367