Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
OptimizeConfigParameters.h
Go to the documentation of this file.
1/**********************************************************************************
2 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
3 * Package: TMVA *
4 * Class : OptimizeConfigParameters *
5 * Web : http://tmva.sourceforge.net *
6 * *
7 * Description: The OptimizeConfigParameters takes care of "scanning/fitting" *
8 * different tuning parameters in order to find the best set of *
9 * tuning paraemters which will be used in the end *
10 * *
11 * Authors (alphabetical): *
12 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
13 * *
14 * Copyright (c) 2005: *
15 * CERN, Switzerland *
16 * MPI-K Heidelberg, Germany *
17 * *
18 * Redistribution and use in source and binary forms, with or without *
19 * modification, are permitted according to the terms listed in LICENSE *
20 * (http://ttmva.sourceforge.net/LICENSE) *
21 **********************************************************************************/
22
23#ifndef ROOT_TMVA_OptimizeConfigParameters
24#define ROOT_TMVA_OptimizeConfigParameters
25
26#include "Rtypes.h"
27
28#include "TString.h"
29
30#include "TMVA/MethodBase.h"
31
32#include "TMVA/Interval.h"
33
34#include "TMVA/DataSet.h"
35
36#include "IFitterTarget.h"
37
38#include "TH1.h"
39
40#include <map>
41#include <vector>
42
43class TestOptimizeConfigParameters;
44
45namespace TMVA {
46
47 class MethodBase;
48 class MsgLogger;
50
51 public:
53
54 //default constructor
55 OptimizeConfigParameters(MethodBase * const method, std::map<TString,TMVA::Interval*> tuneParameters, TString fomType="Separation", TString optimizationType = "GA");
56
57 // destructor
59 // could later be changed to be set via option string...
60 // but for now it's simpler like this
61 std::map<TString,Double_t> optimize();
62
63 private:
64 std::vector< int > GetScanIndices( int val, std::vector<int> base);
65 void optimizeScan();
66 void optimizeFit();
67
68 Double_t EstimatorFunction( std::vector<Double_t> & );
69
71
73
74 void GetMVADists();
77 Double_t GetSigEffAtBkgEff( Double_t bkgEff = 0.1);
78 Double_t GetBkgEffAtSigEff( Double_t sigEff = 0.5);
79 Double_t GetBkgRejAtSigEff( Double_t sigEff = 0.5);
80
81
82 MethodBase* const fMethod; ///< The MVA method to be evaluated
83 std::vector<Float_t> fFOMvsIter; ///< graph showing the development of the Figure Of Merit values during the fit
84 std::map<TString,TMVA::Interval*> fTuneParameters; ///< parameters included in the tuning
85 std::map<TString,Double_t> fTunedParameters; ///< parameters included in the tuning
86 std::map< std::vector<Double_t> , Double_t> fAlreadyTrainedParCombination; ///< save parameters for which the FOM is already known (GA seems to evaluate the same parameters several times)
87 TString fFOMType; ///< the FOM type (Separation, ROC integra.. whatever you implemented..
88 TString fOptimizationFitType; ///< which type of optimisation procedure to be used
89 TH1D *fMvaSig; ///< MVA distribution for signal events, used for spline fit
90 TH1D *fMvaBkg; ///< MVA distribution for bakgr. events, used for spline fit
91
92 TH1D *fMvaSigFineBin; ///< MVA distribution for signal events
93 TH1D *fMvaBkgFineBin; ///< MVA distribution for bakgr. events
94
95 Bool_t fNotDoneYet; ///<flat to indicate of Method Transformations have been obtained yet or not (normally done in MethodBase::TrainMethod)
96
97 mutable MsgLogger* fLogger; ///< message logger
98 MsgLogger& Log() const { return *fLogger; }
99
100 ClassDef(OptimizeConfigParameters,0); // Interface to different separation criteria used in training algorithms
101 };
102} // namespace TMVA
103
104#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:337
1-D histogram with a double per channel (see TH1 documentation)}
Definition TH1.h:620
Interface for a fitter 'target'.
Virtual base Class for all MVA method.
Definition MethodBase.h:111
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
std::vector< int > GetScanIndices(int val, std::vector< int > base)
helper function to scan through the all the combinations in the parameter space
Double_t GetBkgRejAtSigEff(Double_t sigEff=0.5)
calculate the background rejection for a given signal efficiency
std::map< TString, Double_t > fTunedParameters
parameters included in the tuning
virtual ~OptimizeConfigParameters()
the destructor (delete the OptimizeConfigParameters, store the graph and .. delete it)
Double_t GetBkgEffAtSigEff(Double_t sigEff=0.5)
calculate the background efficiency for a given signal efficiency
void optimizeScan()
do the actual optimization using a simple scan method, i.e.
std::map< TString, TMVA::Interval * > fTuneParameters
parameters included in the tuning
MethodBase *const fMethod
The MVA method to be evaluated.
Bool_t fNotDoneYet
flat to indicate of Method Transformations have been obtained yet or not (normally done in MethodBase...
TString fOptimizationFitType
which type of optimisation procedure to be used
std::map< TString, Double_t > optimize()
Double_t GetSeparation()
return the separation between the signal and background MVA ouput distribution
TH1D * fMvaSig
MVA distribution for signal events, used for spline fit.
TString fFOMType
the FOM type (Separation, ROC integra.. whatever you implemented..
Double_t GetFOM()
Return the Figure of Merit (FOM) used in the parameter optimization process.
Double_t GetSigEffAtBkgEff(Double_t bkgEff=0.1)
calculate the signal efficiency for a given background efficiency
Double_t GetROCIntegral()
calculate the area (integral) under the ROC curve as a overall quality measure of the classification
TH1D * fMvaBkg
MVA distribution for bakgr. events, used for spline fit.
TH1D * fMvaBkgFineBin
MVA distribution for bakgr. events.
void GetMVADists()
fill the private histograms with the mva distributions for sig/bkg
Double_t EstimatorFunction(std::vector< Double_t > &)
return the estimator (from current FOM) for the fitting interface
std::vector< Float_t > fFOMvsIter
graph showing the development of the Figure Of Merit values during the fit
std::map< std::vector< Double_t >, Double_t > fAlreadyTrainedParCombination
save parameters for which the FOM is already known (GA seems to evaluate the same parameters several ...
TH1D * fMvaSigFineBin
MVA distribution for signal events.
Basic string class.
Definition TString.h:139
create variable transformations