33 #ifndef ROOT_TMVA_MethodBase 34 #define ROOT_TMVA_MethodBase 53 #ifndef ROOT_TMVA_IMethod 56 #ifndef ROOT_TMVA_Configurable 59 #ifndef ROOT_TMVA_Types 62 #ifndef ROOT_TMVA_DataSet 65 #ifndef ROOT_TMVA_Event 68 #ifndef ROOT_TMVA_TransformationHandler 71 #ifndef ROOT_TMVA_OptimizeConfigParameters 135 virtual void Train() = 0;
161 virtual void Init() = 0;
194 std::vector<Float_t>* ptr =
new std::vector<Float_t>(0);
200 std::vector<Float_t>* ptr =
new std::vector<Float_t>(0);
287 Double_t& optimal_significance_value )
const;
virtual void DeclareOptions()=0
Bool_t HasMVAPdfs() const
Types::EAnalysisType fAnalysisType
virtual void AddClassifierOutputProb(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
void WriteStateToXML(void *parent) const
general method used in writing the header of the weight files where the used variables, variable transformation type etc.
virtual void SetTuneParameters(std::map< TString, Double_t > tuneParameters)
set the tuning parameters accoding to the argument This is just a dummy .
virtual void MakeClass(const TString &classFileName=TString("")) const
create reader class for method (classification only at present)
UInt_t GetNVariables() const
virtual void ReadWeightsFromStream(TFile &)
virtual const std::vector< Float_t > & GetMulticlassValues()
Bool_t GetLine(std::istream &fin, char *buf)
reads one line from the input stream checks for certain keywords and interprets the line if keywords ...
void AddOutput(Types::ETreeType type, Types::EAnalysisType analysisType)
static void CreateVariableTransforms(const TString &trafoDefinition, TMVA::DataSetInfo &dataInfo, TMVA::TransformationHandler &transformationHandler, TMVA::MsgLogger &log)
create variable transformations
Bool_t fIgnoreNegWeightsInTraining
void ReadStateFromXML(void *parent)
const TString & GetInternalName() const
void WriteVarsToStream(std::ostream &tf, const TString &prefix="") const
write the list of variables (name, min, max) for a given data transformation method to the stream ...
Bool_t IsConstructedFromWeightFile() const
virtual Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)=0
virtual void MakeClassSpecificHeader(std::ostream &, const TString &="") const
const TString GetProbaName() const
const TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true) const
virtual const Ranking * CreateRanking()=0
virtual void WriteEvaluationHistosToFile(Types::ETreeType treetype)
writes all MVA evaluation histograms to file
const TString & GetOriginalVarName(Int_t ivar) const
virtual std::map< TString, Double_t > OptimizeTuningParameters(TString fomType="ROCIntegral", TString fitType="FitGA")
call the Optimzier with the set of paremeters and ranges that are meant to be tuned.
TString fVariableTransformTypeString
void SetMethodBaseDir(TDirectory *methodDir)
Base class for spline implementation containing the Draw/Paint methods //.
TransformationHandler * fTransformationPointer
Types::ESBType fVariableTransformType
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
const std::vector< Float_t > & GetRegressionValues(const TMVA::Event *const ev)
void SetSignalReferenceCutOrientation(Double_t cutOrientation)
virtual const std::vector< Float_t > & GetRegressionValues()
1-D histogram with a float per channel (see TH1 documentation)}
void SetTrainTime(Double_t trainTime)
const TString & GetInternalVarName(Int_t ivar) const
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
virtual Double_t GetKSTrainingVsTest(Char_t SorB, TString opt="X")
MethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="", TDirectory *theBaseDir=0)
standard constructur
virtual void TestMulticlass()
test multiclass classification
TString GetTrainingROOTVersionString() const
calculates the ROOT version string from the training version code on the fly
UInt_t GetNTargets() const
std::vector< TString > * fInputVars
virtual void GetRegressionDeviation(UInt_t tgtNum, Types::ETreeType type, Double_t &stddev, Double_t &stddev90Percent) const
const TString & GetLabel() const
void ReadTargetsFromXML(void *tarnode)
read target info from XML
virtual Double_t GetMaximumSignificance(Double_t SignalEvents, Double_t BackgroundEvents, Double_t &optimal_significance_value) const
plot significance, S/Sqrt(S^2 + B^2), curve for given number of signal and background events; returns...
void AddInfoItem(void *gi, const TString &name, const TString &value) const
xml writing
virtual Double_t GetROCIntegral(TH1D *histS, TH1D *histB) const
calculate the area (integral) under the ROC curve as a overall quality measure of the classification ...
TDirectory * MethodBaseDir() const
returns the ROOT directory where all instances of the corresponding MVA method are stored ...
Double_t GetMean(Int_t ivar) const
Double_t GetTrainTime() const
const TString & GetInputLabel(Int_t i) const
virtual Bool_t IsSignalLike()
uses a pre-set cut on the MVA output (SetSignalReferenceCut and SetSignalReferenceCutOrientation) for...
void CreateMVAPdfs()
Create PDFs of the MVA output variables.
void SetMethodDir(TDirectory *methodDir)
void ReadVariablesFromXML(void *varnode)
read variable info from XML
const TString & GetExpression() const
const TString & GetWeightFileDir() const
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
void WriteStateToFile() const
write options and weights to file note that each one text file for the main configuration information...
const TString & GetInputVar(Int_t i) const
TString GetTrainingTMVAVersionString() const
calculates the TMVA version string from the training version code on the fly
DataSetInfo & fDataSetInfo
set to true in order to suppress writing to XML
#define ClassDef(name, id)
ECutOrientation fCutOrientation
virtual ~MethodBase()
destructor
Bool_t TxtWeightsOnly() const
UInt_t GetTrainingTMVAVersionCode() const
TString GetMethodName(Types::EMVA method) const
const Event * GetEvent() const
void ReadStateFromFile()
Function to write options and weights to file.
virtual void AddClassifierOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
virtual Double_t GetRarity(Double_t mvaVal, Types::ESBType reftype=Types::kBackground) const
compute rarity: R(x) = Integrate_[-oo..x] { PDF(x') dx' } where PDF(x) is the PDF of the classifier's...
void PrintHelpMessage() const
prints out method-specific help method
void ReadClassesFromXML(void *clsnode)
read number of classes from XML
void ResetThisBase()
reset required for RootFinder
Double_t GetXmin(Int_t ivar) const
void SetupMethod()
setup of methods
DataSetInfo & DataInfo() const
Bool_t DoRegression() const
virtual void ProcessOptions()=0
virtual Double_t GetProba(const Event *ev)
Long64_t GetNTrainingEvents() const
virtual Double_t GetEfficiency(const TString &, Types::ETreeType, Double_t &err)
fill background efficiency (resp.
virtual std::vector< Float_t > GetMulticlassEfficiency(std::vector< std::vector< Float_t > > &purity)
Double_t GetEffForRoot(Double_t)
returns efficiency as function of cut
const Event * GetTrainingEvent(Long64_t ievt) const
virtual void AddWeightsXMLTo(void *parent) const =0
UInt_t fTMVATrainingVersion
UInt_t GetNEvents() const
temporary event when testing on a different DataSet than the own one
Double_t GetXmax(Int_t ivar) const
TransformationHandler fTransformation
void ReadStateFromXMLString(const char *xmlstr)
for reading from memory
Bool_t DoMulticlass() const
virtual void MakeClassSpecific(std::ostream &, const TString &="") const
virtual void ReadWeightsFromXML(void *wghtnode)=0
const Event * GetTestingEvent(Long64_t ievt) const
void WriteStateToStream(std::ostream &tf) const
general method used in writing the header of the weight files where the used variables, variable transformation type etc.
UInt_t GetNTargets() const
Bool_t HasTrainingTree() const
TDirectory * fMethodBaseDir
UInt_t fROOTTrainingVersion
const char * GetName() const
Returns name of object.
void ReadVarsFromStream(std::istream &istr)
Read the variables (name, min, max) for a given data transformation method from the stream...
void AddClassesXMLTo(void *parent) const
write class info to XML
void Statistics(Types::ETreeType treeType, const TString &theVarName, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &)
calculates rms,mean, xmin, xmax of the event variable this can be either done for the variables as th...
UInt_t GetTrainingROOTVersionCode() const
const TString & GetJobName() const
const TString & GetMethodName() const
TSpline * fSplTrainEffBvsS
static MethodBase *& GetThisBaseThreadLocal()
void DeclareBaseOptions()
define the options (their key words) that can be set in the option string here the options valid for ...
1-D histogram with a double per channel (see TH1 documentation)}
virtual Double_t GetSignificance() const
compute significance of mean difference significance = |<S> - |/Sqrt(RMS_S2 + RMS_B2) ...
TString GetWeightFileName() const
retrieve weight file name
Double_t GetSignalReferenceCutOrientation() const
void SetNormalised(Bool_t norm)
void ProcessBaseOptions()
the option string is decoded, for availabel options see "DeclareOptions"
Double_t GetTestTime() const
UInt_t GetNVariables() const
std::vector< const std::vector< TMVA::Event * > * > fEventCollections
void AddSpectatorsXMLTo(void *parent) const
write spectator info to XML
TString fVerbosityLevelString
Bool_t IgnoreEventsWithNegWeightsInTraining() const
const std::vector< TMVA::Event * > & GetEventCollection(Types::ETreeType type)
returns the event collection (i.e.
virtual void CheckSetup()
check may be overridden by derived class (sometimes, eg, fitters are used which can only be implement...
void RerouteTransformationHandler(TransformationHandler *fTargetTransformation)
void SetTestTime(Double_t testTime)
virtual void AddRegressionOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
void SetWeightFileName(TString)
set the weight file name (depreciated)
virtual Double_t GetSeparation(TH1 *, TH1 *) const
compute "separation" defined as <s2> = (1/2) Int_-oo..+oo { (S(x) - B(x))^2/(S(x) + B(x)) dx } ...
Describe directory structure in memory.
std::vector< Float_t > * fMulticlassReturnVal
Bool_t IsNormalised() const
const TString & GetTitle() const
void AddVarsXMLTo(void *parent) const
write variable info to XML
VariableInfo & GetVariableInfo(Int_t i)
virtual void WriteMonitoringHistosToFile() const
write special monitoring histograms to file dummy implementation here --------------— ...
Bool_t fConstructedFromWeightFile
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
TString fVarTransformString
virtual void AddMulticlassOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
const TString & GetInputTitle(Int_t i) const
Double_t GetRMS(Int_t ivar) const
Abstract ClassifierFactory template that handles arbitrary types.
virtual std::vector< Float_t > GetMulticlassTrainingEfficiency(std::vector< std::vector< Float_t > > &purity)
virtual void TestRegression(Double_t &bias, Double_t &biasT, Double_t &dev, Double_t &devT, Double_t &rms, Double_t &rmsT, Double_t &mInf, Double_t &mInfT, Double_t &corr, Types::ETreeType type)
calculate <sum-of-deviation-squared> of regression output versus "true" value from test sample ...
TDirectory * BaseDir() const
returns the ROOT directory where info/histograms etc of the corresponding MVA method instance are sto...
TString GetMethodTypeName() const
static MethodBase * GetThisBase()
return a pointer the base class of this method
virtual void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
Double_t fSignalReferenceCut
the data set information (sometimes needed)
void SetWeightFileDir(TString fileDir)
set directory of weight file
Double_t GetSignalReferenceCut() const
A Graph is a graphics object made of two arrays X and Y with npoints each.
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
virtual Double_t GetTrainingEfficiency(const TString &)
void ReadSpectatorsFromXML(void *specnode)
read spectator info from XML
void DisableWriting(Bool_t setter)
ECutOrientation GetCutOrientation() const
void InitBase()
default initialization called by all constructors
std::vector< Float_t > * fRegressionReturnVal
Types::EAnalysisType GetAnalysisType() const
A TTree object has a header with a name and a title.
void AddTargetsXMLTo(void *parent) const
write target info to XML
static Double_t IGetEffForRoot(Double_t)
interface for RootFinder
const TString & GetTestvarName() const
virtual void ReadWeightsFromStream(std::istream &)=0
void SetTestvarName(const TString &v="")
double norm(double *x, double *p)
DataSet * GetDataSet() const
returns data set
Types::EMVA GetMethodType() const
virtual void TestClassification()
initialization
void SetBaseDir(TDirectory *methodDir)
void ReadStateFromStream(std::istream &tf)
read the header from the weight files of the different MVA methods
virtual void SetAnalysisType(Types::EAnalysisType type)
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
void SetSignalReferenceCut(Double_t cut)
Double_t fSignalReferenceCutOrientation
const char * Data() const