File indexing completed on 2025-01-18 10:11:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef ROOT_TMVA_OptimizeConfigParameters
0024 #define ROOT_TMVA_OptimizeConfigParameters
0025
0026 #include "Rtypes.h"
0027
0028 #include "TString.h"
0029
0030 #include "TMVA/MethodBase.h"
0031
0032 #include "TMVA/Interval.h"
0033
0034 #include "TMVA/DataSet.h"
0035
0036 #include "IFitterTarget.h"
0037
0038 #include "TH1.h"
0039
0040 #include <map>
0041 #include <vector>
0042
0043 class TestOptimizeConfigParameters;
0044
0045 namespace TMVA {
0046
0047 class MethodBase;
0048 class MsgLogger;
0049 class OptimizeConfigParameters : public IFitterTarget {
0050
0051 public:
0052 friend TestOptimizeConfigParameters;
0053
0054
0055 OptimizeConfigParameters(MethodBase * const method, std::map<TString,TMVA::Interval*> tuneParameters, TString fomType="Separation", TString optimizationType = "GA");
0056
0057
0058 virtual ~OptimizeConfigParameters();
0059
0060
0061 std::map<TString,Double_t> optimize();
0062
0063 private:
0064 std::vector< int > GetScanIndices( int val, std::vector<int> base);
0065 void optimizeScan();
0066 void optimizeFit();
0067
0068 Double_t EstimatorFunction( std::vector<Double_t> & );
0069
0070 Double_t GetFOM();
0071
0072 MethodBase* GetMethod(){return fMethod;}
0073
0074 void GetMVADists();
0075 Double_t GetSeparation();
0076 Double_t GetROCIntegral();
0077 Double_t GetSigEffAtBkgEff( Double_t bkgEff = 0.1);
0078 Double_t GetBkgEffAtSigEff( Double_t sigEff = 0.5);
0079 Double_t GetBkgRejAtSigEff( Double_t sigEff = 0.5);
0080
0081
0082 MethodBase* const fMethod;
0083 std::vector<Float_t> fFOMvsIter;
0084 std::map<TString,TMVA::Interval*> fTuneParameters;
0085 std::map<TString,Double_t> fTunedParameters;
0086 std::map< std::vector<Double_t> , Double_t> fAlreadyTrainedParCombination;
0087 TString fFOMType;
0088 TString fOptimizationFitType;
0089 TH1D *fMvaSig;
0090 TH1D *fMvaBkg;
0091
0092 TH1D *fMvaSigFineBin;
0093 TH1D *fMvaBkgFineBin;
0094
0095 Bool_t fNotDoneYet;
0096
0097 mutable MsgLogger* fLogger;
0098 MsgLogger& Log() const { return *fLogger; }
0099
0100 ClassDef(OptimizeConfigParameters,0);
0101 };
0102 }
0103
0104 #endif