|
ROOT
Reference Guide |
|
Go to the documentation of this file.
33 #ifndef ROOT_TMVA_MethodBase
34 #define ROOT_TMVA_MethodBase
89 namespace Experimental {
92 class TrainingHistory;
98 void Init(std::vector<TString>& graphTitles);
101 void AddPoint(std::vector<Double_t>& dat);
129 const TString& theOption =
"" );
221 std::vector<Float_t>* ptr =
new std::vector<Float_t>(0);
227 std::vector<Float_t>* ptr =
new std::vector<Float_t>(0);
233 std::vector<Float_t>* ptr =
new std::vector<Float_t>(0);
321 Double_t& optimal_significance_value )
const;
752 return GetTransformationHandler().Transform(fTmpEvent);
754 return GetTransformationHandler().Transform(Data()->GetEvent());
759 assert(fTmpEvent==0);
760 return GetTransformationHandler().Transform(Data()->GetEvent(ievt));
765 assert(fTmpEvent==0);
766 return GetTransformationHandler().Transform(Data()->GetEvent(ievt,
type));
771 assert(fTmpEvent==0);
777 assert(fTmpEvent==0);
virtual void TestClassification()
initialization
Double_t fSignalReferenceCut
the data set information (sometimes needed)
void AddClassesXMLTo(void *parent) const
write class info to XML
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
IPythonInteractive()
standard constructor
void WriteStateToStream(std::ostream &tf) const
general method used in writing the header of the weight files where the used variables,...
Multivariate optimisation of signal efficiency for given background efficiency, applying rectangular ...
TDirectory * BaseDir() const
returns the ROOT directory where info/histograms etc of the corresponding MVA method instance are sto...
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
virtual Double_t GetProba(const Event *ev)
TString fVarTransformString
TMultiGraph * fMultiGraph
virtual std::vector< Float_t > GetMulticlassEfficiency(std::vector< std::vector< Float_t > > &purity)
virtual Double_t GetSeparation(TH1 *, TH1 *) const
compute "separation" defined as
const TString GetProbaName() const
void SetModelPersistence(Bool_t status)
void Init(std::vector< TString > &graphTitles)
This function gets some title and it creates a TGraph for every title.
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
TransformationHandler fTransformation
Types::EAnalysisType GetAnalysisType() const
Bool_t IsConstructedFromWeightFile() const
void ReadStateFromXMLString(const char *xmlstr)
for reading from memory
~IPythonInteractive()
standard destructor
virtual void ReadWeightsFromStream(std::istream &)=0
void SetupMethod()
setup of methods
void WriteStateToFile() const
write options and weights to file note that each one text file for the main configuration information...
TString GetWeightFileName() const
retrieve weight file name
const char * Data() const
std::vector< Float_t > * fRegressionReturnVal
Bool_t IsModelPersistence() const
virtual const char * GetTitle() const
Returns title of object.
Ranking for variables in method (implementation)
void ReadStateFromXML(void *parent)
DataSet * GetDataSet() const
returns data set
Double_t GetXmax(Int_t ivar) const
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 ...
Bool_t IsNormalised() const
void SetSilentFile(Bool_t status)
virtual void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
A TTree represents a columnar dataset.
1-D histogram with a double per channel (see TH1 documentation)}
UInt_t GetNVariables() const
virtual std::vector< Float_t > GetMulticlassTrainingEfficiency(std::vector< std::vector< Float_t > > &purity)
virtual void ReadWeightsFromXML(void *wghtnode)=0
Double_t GetTestTime() const
UInt_t fTMVATrainingVersion
void ReadTargetsFromXML(void *tarnode)
read target info from XML
virtual void AddClassifierOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
std::vector< Float_t > * fMulticlassReturnVal
DataSetInfo & fDataSetInfo
Bool_t HasMVAPdfs() const
virtual void AddMulticlassOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
const std::vector< Float_t > & GetRegressionValues(const TMVA::Event *const ev)
Base class for spline implementation containing the Draw/Paint methods.
UInt_t GetNTargets() 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 ReadVariablesFromXML(void *varnode)
read variable info from XML
void ReadStateFromStream(std::istream &tf)
read the header from the weight files of the different MVA methods
void SetSignalReferenceCut(Double_t cut)
Types::ESBType fVariableTransformType
TDirectory * fMethodBaseDir
TString GetMethodName(Types::EMVA method) const
void AddSpectatorsXMLTo(void *parent) const
write spectator info to XML
const TString & GetJobName() const
Class for categorizing the phase space.
TString GetTrainingROOTVersionString() const
calculates the ROOT version string from the training version code on the fly
TString GetTrainingTMVAVersionString() const
calculates the TMVA version string from the training version code on the fly
TString fVariableTransformTypeString
const char * GetInputTitle(Int_t i) const
Virtual base class for combining several TMVA method.
VariableInfo & GetVariableInfo(Int_t i)
void AddPoint(Double_t x, Double_t y1, Double_t y2)
This function is used only in 2 TGraph case, and it will add new data points to graphs.
void ProcessBaseOptions()
the option string is decoded, for available options see "DeclareOptions"
Bool_t DoMulticlass() const
UInt_t GetNVariables() const
Bool_t IgnoreEventsWithNegWeightsInTraining() const
virtual void MakeClassSpecificHeader(std::ostream &, const TString &="") const
virtual Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)=0
void SetTestTime(Double_t testTime)
DataSetInfo & DataInfo() const
UInt_t GetTrainingROOTVersionCode() const
UInt_t GetTrainingTMVAVersionCode() const
virtual void ProcessOptions()=0
virtual Double_t GetRarity(Double_t mvaVal, Types::ESBType reftype=Types::kBackground) const
compute rarity:
Class that contains all the data information.
TransformationHandler * fTransformationPointer
Double_t GetXmin(Int_t ivar) const
ECutOrientation fCutOrientation
void RerouteTransformationHandler(TransformationHandler *fTargetTransformation)
const Event * GetTrainingEvent(Long64_t ievt) const
void ReadClassesFromXML(void *clsnode)
read number of classes from XML
IPythonInteractive * fInteractive
void SetWeightFileName(TString)
set the weight file name (depreciated)
virtual void WriteMonitoringHistosToFile() const
write special monitoring histograms to file dummy implementation here --------------—
const TString & GetMethodName() const
virtual void AddRegressionOutput(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
virtual std::vector< Double_t > GetMvaValues(Long64_t firstEvt=0, Long64_t lastEvt=-1, Bool_t logProgress=false)
get all the MVA values for the events of the current Data type
const TString & GetOriginalVarName(Int_t ivar) const
Class for boosting a TMVA method.
virtual Double_t GetMaximumSignificance(Double_t SignalEvents, Double_t BackgroundEvents, Double_t &optimal_significance_value) const
plot significance, , curve for given number of signal and background events; returns cut for maximum ...
MethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="")
standard constructor
virtual void CheckSetup()
check may be overridden by derived class (sometimes, eg, fitters are used which can only be implement...
Double_t GetSignalReferenceCutOrientation() const
void AddVarsXMLTo(void *parent) const
write variable info to XML
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
UInt_t fROOTTrainingVersion
std::vector< const std::vector< TMVA::Event * > * > fEventCollections
virtual ~MethodBase()
destructor
virtual const std::vector< Float_t > & GetMulticlassValues()
void SetMethodBaseDir(TDirectory *methodDir)
virtual void WriteEvaluationHistosToFile(Types::ETreeType treetype)
writes all MVA evaluation histograms to file
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
Linear interpolation of TGraph.
Class that contains all the data information.
Root finding using Brents algorithm (translated from CERNLIB function RZERO)
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
UInt_t GetNEvents() const
temporary event when testing on a different DataSet than the own one
void ReadStateFromFile()
Function to write options and weights to file.
This is the main MVA steering class.
const TString & GetWeightFileDir() const
virtual Double_t GetKSTrainingVsTest(Char_t SorB, TString opt="X")
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...
virtual void AddWeightsXMLTo(void *parent) const =0
virtual std::map< TString, Double_t > OptimizeTuningParameters(TString fomType="ROCIntegral", TString fitType="FitGA")
call the Optimizer with the set of parameters and ranges that are meant to be tuned.
void SetWeightFileDir(TString fileDir)
set directory of weight file
void DeclareBaseOptions()
define the options (their key words) that can be set in the option string here the options valid for ...
TString GetMethodTypeName() const
Virtual base Class for all MVA method.
const std::vector< TMVA::Event * > & GetEventCollection(Types::ETreeType type)
returns the event collection (i.e.
void DisableWriting(Bool_t setter)
Class that is the base-class for a vector of result.
std::vector< TString > * fInputVars
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
const TString & GetInternalName() const
void SetMethodDir(TDirectory *methodDir)
void WriteStateToXML(void *parent) const
general method used in writing the header of the weight files where the used variables,...
void InitBase()
default initialization called by all constructors
Bool_t DoRegression() const
Bool_t IsSilentFile() const
Interface for all concrete MVA method implementations.
PDF wrapper for histograms; uses user-defined spline interpolation.
void ReadVarsFromStream(std::istream &istr)
Read the variables (name, min, max) for a given data transformation method from the stream.
const TString & GetInputLabel(Int_t i) const
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual void SetTuneParameters(std::map< TString, Double_t > tuneParameters)
set the tuning parameters according to the argument This is just a dummy .
const TString & GetTestvarName() const
UInt_t GetNTargets() const
void AddInfoItem(void *gi, const TString &name, const TString &value) const
xml writing
Double_t GetRMS(Int_t ivar) const
virtual Double_t GetSignificance() const
compute significance of mean difference
const TString & GetInputVar(Int_t i) const
std::vector< TGraph * > fGraphs
A TGraph is an object made of two arrays X and Y with npoints each.
This class is needed by JsMVA, and it's a helper class for tracking errors during the training in Jup...
Bool_t TxtWeightsOnly() const
virtual void MakeClass(const TString &classFileName=TString("")) const
create reader class for method (classification only at present)
virtual void SetAnalysisType(Types::EAnalysisType type)
void ClearGraphs()
This function sets the point number to 0 for all graphs.
virtual const std::vector< Float_t > & GetRegressionValues()
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
const Event * GetTestingEvent(Long64_t ievt) const
1-D histogram with a float per channel (see TH1 documentation)}
virtual TMatrixD GetMulticlassConfusionMatrix(Double_t effB, Types::ETreeType type)
Construct a confusion matrix for a multiclass classifier.
const char * GetName() const
virtual void MakeClassSpecific(std::ostream &, const TString &="") const
TDirectory * MethodBaseDir() const
returns the ROOT directory where all instances of the corresponding MVA method are stored
#define ClassDef(name, id)
void SetBaseDir(TDirectory *methodDir)
TH1 is the base class of all histogramm classes in ROOT.
void SetSignalReferenceCutOrientation(Double_t cutOrientation)
const Event * GetEvent() const
virtual Double_t GetEfficiency(const TString &, Types::ETreeType, Double_t &err)
fill background efficiency (resp.
virtual void TestMulticlass()
test multiclass classification
const TString & GetLabel() const
Double_t GetMean(Int_t ivar) const
Double_t fSignalReferenceCutOrientation
Types::EMVA GetMethodType() const
Describe directory structure in memory.
const TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true) const
const TString & GetExpression() const
void SetFile(TFile *file)
void SetTestvarName(const TString &v="")
TrainingHistory fTrainHistory
virtual const std::vector< Float_t > & GetTrainingHistory(const char *)
void PrintHelpMessage() const
prints out method-specific help method
void SetTrainTime(Double_t trainTime)
virtual const Ranking * CreateRanking()=0
virtual void AddClassifierOutputProb(Types::ETreeType type)
prepare tree branch with the method's discriminating variable
Double_t GetSignalReferenceCut() const
virtual Double_t GetTrainingEfficiency(const TString &)
TString fVerbosityLevelString
Long64_t GetNTrainingEvents() const
void AddOutput(Types::ETreeType type, Types::EAnalysisType analysisType)
virtual Double_t GetValueForRoot(Double_t)
returns efficiency as function of cut
Bool_t HasTrainingTree() const
TSpline * fSplTrainEffBvsS
void InitIPythonInteractive()
Bool_t fConstructedFromWeightFile
Tracking data from training.
Class to perform two class classification.
void SetNormalised(Bool_t norm)
void AddTargetsXMLTo(void *parent) const
write target info to XML
virtual void DeclareOptions()=0
const TString & GetInternalVarName(Int_t ivar) const
virtual void GetRegressionDeviation(UInt_t tgtNum, Types::ETreeType type, Double_t &stddev, Double_t &stddev90Percent) const
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
Types::EAnalysisType fAnalysisType
Class to perform cross validation, splitting the dataloader into folds.
Bool_t fIgnoreNegWeightsInTraining
void ReadSpectatorsFromXML(void *specnode)
read spectator info from XML
create variable transformations
ECutOrientation GetCutOrientation() const
TMultiGraph * GetInteractiveTrainingError()
Double_t GetTrainTime() const