51 #define MinNoTrainingEvents 10 81 auto roc =
GetROC(iClass, type);
82 auto inte = roc->GetROCIntegral();
128 TString hLine =
"--------------------------------------------------- :";
130 fLogger << kINFO << hLine <<
Endl;
131 fLogger << kINFO <<
"DataSet MVA :" <<
Endl;
132 fLogger << kINFO <<
"Name: Method/Title: ROC-integ :" <<
Endl;
133 fLogger << kINFO << hLine <<
Endl;
139 fLogger << kINFO << hLine <<
Endl;
184 :
TMVA::
Envelope(
"Classification", dataloader, file, options), fAnalysisType(
Types::kClassification),
239 if (meth.GetValue<
TString>(
"MethodName") == methodname && meth.GetValue<
TString>(
"MethodTitle") == methodtitle)
240 return meth.GetValue<
TString>(
"MethodOptions");
270 auto methodname = fMethods[workerID].GetValue<
TString>(
"MethodName");
271 auto methodtitle = fMethods[workerID].GetValue<
TString>(
"MethodTitle");
272 auto meth =
GetMethod(methodname, methodtitle);
274 auto fname =
Form(
".%s%s%s.root",
fDataLoader->GetName(), methodname.Data(), methodtitle.
Data());
275 auto f =
new TFile(fname,
"RECREATE");
296 TString hLine =
"--------------------------------------------------- :";
297 Log() << kINFO << hLine <<
Endl;
298 Log() << kINFO <<
"DataSet MVA :" <<
Endl;
299 Log() << kINFO <<
"Name: Method/Title: ROC-integ :" <<
Endl;
300 Log() << kINFO << hLine <<
Endl;
303 Log() << kINFO <<
Form(
"%-20s %-15s %#1.3f :",
r.GetDataLoaderName().Data(),
304 Form(
"%s/%s",
r.GetMethodName().Data(),
r.GetMethodTitle().Data()),
r.GetROCIntegral())
307 Log() << kINFO << hLine <<
Endl;
309 Log() << kINFO <<
"-----------------------------------------------------" <<
Endl;
310 Log() << kHEADER <<
"Evaluation done." << Endl <<
Endl;
312 Log() << kINFO <<
"-----------------------------------------------------" <<
Endl;
313 Log() << kINFO <<
"Evaluation done." <<
Endl;
336 auto method =
GetMethod(methodname, methodtitle);
339 <<
Form(
"Trying to train method %s %s that maybe is not booked.", methodname.
Data(), methodtitle.
Data())
347 method->DataInfo().GetNClasses() < 2)
348 Log() << kFATAL <<
"You want to do classification training, but specified less than two classes." <<
Endl;
354 Log() << kWARNING <<
"Method " << method->GetMethodName() <<
" not trained (training tree has less entries [" 359 Log() << kHEADER <<
"Train method: " << method->GetMethodName() <<
" for Classification" << Endl <<
Endl;
360 method->TrainMethod();
361 Log() << kHEADER <<
"Training finished" << Endl <<
Endl;
386 if (!
HasMethod(methodname, methodtitle)) {
387 std::cout << methodname <<
" " << methodtitle << std::endl;
388 Log() << kERROR <<
"Trying to get method not booked." <<
Endl;
398 Log() << kFATAL <<
"No input data for the training provided!" <<
Endl;
400 Log() << kHEADER <<
"Loading booked method: " <<
gTools().
Color(
"bold") << methodname <<
" " << methodtitle
408 conf->DeclareOptionRef(boostNum = 0,
"Boost_num",
"Number of times the classifier will be boosted");
409 conf->ParseOptions();
426 Log() << kDEBUG <<
"Boost Number is " << boostNum <<
" > 0: train boosted classifier" <<
Endl;
431 Log() << kFATAL <<
"Method with type kBoost cannot be casted to MethodCategory. /Classification" <<
Endl;
450 Log() << kFATAL <<
"Method with type kCategory cannot be casted to MethodCategory. /Classification" <<
Endl;
462 Log() << kWARNING <<
"Method " << method->
GetMethodTypeName() <<
" is not capable of handling ";
498 if (methbase->GetMethodTypeName() == methodname && methbase->GetMethodName() == methodtitle) {
525 auto method =
GetMethod(methodname, methodtitle);
528 <<
Form(
"Trying to train method %s %s that maybe is not booked.", methodname.
Data(), methodtitle.
Data())
536 Log() << kHEADER <<
"Test method: " << method->GetMethodName() <<
" for Classification" 548 Int_t nmeth_used[2] = {0, 0};
550 std::vector<std::vector<TString>> mname(2);
551 std::vector<std::vector<Double_t>> sig(2),
sep(2), roc(2);
552 std::vector<std::vector<Double_t>> eff01(2), eff10(2), eff30(2), effArea(2);
553 std::vector<std::vector<Double_t>> eff01err(2), eff10err(2), eff30err(2);
554 std::vector<std::vector<Double_t>> trainEff01(2), trainEff10(2), trainEff30(2);
556 method->SetFile(
fFile.get());
561 methodNoCuts = method;
563 Log() << kHEADER <<
"Evaluate classifier: " << method->GetMethodName() << Endl <<
Endl;
564 isel = (method->GetMethodTypeName().Contains(
"Variable")) ? 1 : 0;
567 method->TestClassification();
570 mname[isel].push_back(method->GetMethodName());
571 sig[isel].push_back(method->GetSignificance());
572 sep[isel].push_back(method->GetSeparation());
573 roc[isel].push_back(method->GetROCIntegral());
576 eff01[isel].push_back(method->GetEfficiency(
"Efficiency:0.01",
Types::kTesting, err));
577 eff01err[isel].push_back(err);
578 eff10[isel].push_back(method->GetEfficiency(
"Efficiency:0.10",
Types::kTesting, err));
579 eff10err[isel].push_back(err);
580 eff30[isel].push_back(method->GetEfficiency(
"Efficiency:0.30",
Types::kTesting, err));
581 eff30err[isel].push_back(err);
582 effArea[isel].push_back(method->GetEfficiency(
"",
Types::kTesting, err));
584 trainEff01[isel].push_back(method->GetTrainingEfficiency(
"Efficiency:0.01"));
585 trainEff10[isel].push_back(method->GetTrainingEfficiency(
"Efficiency:0.10"));
586 trainEff30[isel].push_back(method->GetTrainingEfficiency(
"Efficiency:0.30"));
591 Log() << kDEBUG <<
"\tWrite evaluation histograms to file" <<
Endl;
597 for (
Int_t k = 0; k < 2; k++) {
598 std::vector<std::vector<Double_t>> vtemp;
599 vtemp.push_back(effArea[k]);
600 vtemp.push_back(eff10[k]);
601 vtemp.push_back(eff01[k]);
602 vtemp.push_back(eff30[k]);
603 vtemp.push_back(eff10err[k]);
604 vtemp.push_back(eff01err[k]);
605 vtemp.push_back(eff30err[k]);
606 vtemp.push_back(trainEff10[k]);
607 vtemp.push_back(trainEff01[k]);
608 vtemp.push_back(trainEff30[k]);
609 vtemp.push_back(sig[k]);
610 vtemp.push_back(
sep[k]);
611 vtemp.push_back(roc[k]);
612 std::vector<TString> vtemps = mname[k];
614 effArea[k] = vtemp[0];
618 eff10err[k] = vtemp[4];
619 eff01err[k] = vtemp[5];
620 eff30err[k] = vtemp[6];
621 trainEff10[k] = vtemp[7];
622 trainEff01[k] = vtemp[8];
623 trainEff30[k] = vtemp[9];
637 const Int_t nmeth = methodNoCuts == NULL ? 0 : 1;
643 std::vector<Double_t> rvec;
650 std::vector<TString> *theVars =
new std::vector<TString>;
651 std::vector<ResultsClassification *> mvaRes;
654 theVars->back().ReplaceAll(
"MVA_",
"");
655 mvaRes.push_back(dynamic_cast<ResultsClassification *>(
665 DataSet *defDs = method->fDataSetInfo.GetDataSet();
672 for (
Int_t im = 0; im < nmeth; im++) {
676 Log() << kWARNING <<
"Found NaN return value in event: " << ievt <<
" for method \"" 682 for (
Int_t iv = 0; iv < nvar; iv++)
684 if (method->fDataSetInfo.IsSignal(ev)) {
693 for (
Int_t im = 0; im < nmeth; im++) {
694 for (
Int_t jm = im; jm < nmeth; jm++) {
695 if ((dvec[im] - rvec[im]) * (dvec[jm] - rvec[jm]) > 0) {
718 if (corrMatS != 0 && corrMatB != 0) {
723 for (
Int_t im = 0; im < nmeth; im++) {
724 for (
Int_t jm = 0; jm < nmeth; jm++) {
725 mvaMatS(im, jm) = (*corrMatS)(im, jm);
726 mvaMatB(im, jm) = (*corrMatB)(im, jm);
731 std::vector<TString> theInputVars;
734 for (
Int_t iv = 0; iv < nvar; iv++) {
735 theInputVars.push_back(method->fDataSetInfo.GetVariableInfo(iv).GetLabel());
736 for (
Int_t jm = 0; jm < nmeth; jm++) {
737 varmvaMatS(iv, jm) = (*corrMatS)(nmeth + iv, jm);
738 varmvaMatB(iv, jm) = (*corrMatB)(nmeth + iv, jm);
744 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
745 <<
"Inter-MVA correlation matrix (signal):" << Endl;
749 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
750 <<
"Inter-MVA correlation matrix (background):" << Endl;
755 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
756 <<
"Correlations between input variables and MVA response (signal):" << Endl;
760 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
761 <<
"Correlations between input variables and MVA response (background):" << Endl;
765 Log() << kWARNING <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
766 <<
"<TestAllMethods> cannot compute correlation matrices" << Endl;
769 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
770 <<
"The following \"overlap\" matrices contain the fraction of events for which " << Endl;
771 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
772 <<
"the MVAs 'i' and 'j' have returned conform answers about \"signal-likeness\"" << Endl;
773 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
774 <<
"An event is signal-like, if its MVA output exceeds the following value:" << Endl;
776 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
777 <<
"which correspond to the working point: eff(signal) = 1 - eff(background)" << Endl;
781 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
782 <<
"Note: no correlations and overlap with cut method are provided at present" << Endl;
786 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
787 <<
"Inter-MVA overlap matrix (signal):" << Endl;
791 Log() << kINFO <<
Form(
"Dataset[%s] : ", method->fDataSetInfo.GetName())
792 <<
"Inter-MVA overlap matrix (background):" << Endl;
813 auto &fResult =
GetResults(methodname, methodtitle);
820 TString hLine =
"------------------------------------------------------------------------------------------" 821 "-------------------------";
822 Log() << kINFO <<
"Evaluation results ranked by best signal efficiency and purity (area)" <<
Endl;
823 Log() << kINFO << hLine <<
Endl;
824 Log() << kINFO <<
"DataSet MVA " <<
Endl;
825 Log() << kINFO <<
"Name: Method: ROC-integ" <<
Endl;
827 Log() << kDEBUG << hLine <<
Endl;
828 for (
Int_t k = 0; k < 2; k++) {
829 if (k == 1 && nmeth_used[k] > 0) {
830 Log() << kINFO << hLine <<
Endl;
831 Log() << kINFO <<
"Input Variables: " << Endl << hLine <<
Endl;
833 for (
Int_t i = 0; i < nmeth_used[k]; i++) {
835 TString methodName = mname[k][i];
843 std::vector<Bool_t> *mvaResType =
dynamic_cast<ResultsClassification *
>(results)->GetValueVectorTypes();
846 if (mvaResType->size() != 0) {
850 if (
sep[k][i] < 0 || sig[k][i] < 0) {
852 fResult.fROCIntegral = effArea[k][i];
854 <<
Form(
"%-13s %-15s: %#1.3f",
fDataLoader->GetName(), methodName.
Data(), fResult.fROCIntegral)
857 fResult.fROCIntegral = rocIntegral;
858 Log() << kINFO <<
Form(
"%-13s %-15s: %#1.3f", datasetName.
Data(), methodName.
Data(), rocIntegral)
863 Log() << kINFO << hLine <<
Endl;
865 Log() << kINFO <<
"Testing efficiency compared to training efficiency (overtraining check)" <<
Endl;
866 Log() << kINFO << hLine <<
Endl;
868 <<
"DataSet MVA Signal efficiency: from test sample (from training sample) " 870 Log() << kINFO <<
"Name: Method: @B=0.01 @B=0.10 @B=0.30 " 872 Log() << kINFO << hLine <<
Endl;
873 for (
Int_t k = 0; k < 2; k++) {
874 if (k == 1 && nmeth_used[k] > 0) {
875 Log() << kINFO << hLine <<
Endl;
876 Log() << kINFO <<
"Input Variables: " << Endl << hLine <<
Endl;
878 for (
Int_t i = 0; i < nmeth_used[k]; i++) {
880 mname[k][i].ReplaceAll(
"Variable_",
"");
882 Log() << kINFO <<
Form(
"%-20s %-15s: %#1.3f (%#1.3f) %#1.3f (%#1.3f) %#1.3f (%#1.3f)",
883 method->fDataSetInfo.GetName(), (
const char *)mname[k][i], eff01[k][i],
884 trainEff01[k][i], eff10[k][i], trainEff10[k][i], eff30[k][i], trainEff30[k][i])
888 Log() << kINFO << hLine <<
Endl;
894 for (
Int_t k = 0; k < 2; k++) {
895 for (
Int_t i = 0; i < nmeth_used[k]; i++) {
897 if (
sep[k][i] < 0 || sig[k][i] < 0) {
899 fResult.fROCIntegral = effArea[k][i];
909 fResult.fIsCuts =
kTRUE;
912 fResult.fMvaTest[0] = rocCurveTest->GetMvas();
915 TString className = method->DataInfo().GetClassInfo(0)->GetName();
916 fResult.fClassNames.push_back(className);
945 Log() << kFATAL <<
"No Classification results available" <<
Endl;
970 if (result.IsMethod(methodname, methodtitle))
974 result.
fMethod[
"MethodName"] = methodname;
975 result.
fMethod[
"MethodTitle"] = methodtitle;
977 fResults.push_back(result);
978 return fResults.back();
998 Log() << kERROR <<
Form(
"Given class number (iClass = %i) does not exist. There are %i classes in dataset.",
1008 std::vector<Bool_t> *mvaResTypes =
dynamic_cast<ResultsClassification *
>(results)->GetValueVectorTypes();
1009 std::vector<Float_t> mvaResWeights;
1012 mvaResWeights.reserve(eventCollection.size());
1013 for (
auto ev : eventCollection) {
1014 mvaResWeights.push_back(ev->GetWeight());
1017 rocCurve =
new TMVA::ROCCurve(*mvaRes, *mvaResTypes, mvaResWeights);
1020 std::vector<Float_t> mvaRes;
1021 std::vector<Bool_t> mvaResTypes;
1022 std::vector<Float_t> mvaResWeights;
1024 std::vector<std::vector<Float_t>> *rawMvaRes =
dynamic_cast<ResultsMulticlass *
>(results)->GetValueVector();
1029 mvaRes.reserve(rawMvaRes->size());
1030 for (
auto item : *rawMvaRes) {
1031 mvaRes.push_back(item[iClass]);
1035 mvaResTypes.reserve(eventCollection.size());
1036 mvaResWeights.reserve(eventCollection.size());
1037 for (
auto ev : eventCollection) {
1038 mvaResTypes.push_back(ev->GetClass() == iClass);
1039 mvaResWeights.push_back(ev->GetWeight());
1042 rocCurve =
new TMVA::ROCCurve(mvaRes, mvaResTypes, mvaResWeights);
1076 <<
Form(
"ROCCurve object was not created in MethodName = %s MethodTitle = %s not found with Dataset = %s ",
1092 TFile *savdir = file;
1098 while ((key = (
TKey *)nextkey())) {
1131 TTree *TrainTree = 0;
1132 TTree *TestTree = 0;
1138 auto fname =
Form(
".%s%s%s.root",
fDataLoader->GetName(), methodname.Data(), methodtitle.
Data());
1141 ifile =
new TFile(fname);
1144 ofile =
new TFile(fname);
1147 auto tmptrain = (
TTree *)ds->Get(
"TrainTree");
1148 auto tmptest = (
TTree *)ds->Get(
"TestTree");
1152 auto methdirname =
Form(
"Method_%s", methodtitle.
Data());
1153 auto methdir = dsdir->mkdir(methdirname, methdirname);
1154 auto methdirbase = methdir->mkdir(methodtitle.
Data(), methodtitle.
Data());
1161 TrainTree = tmptrain->
CopyTree(
"");
1165 auto trainbranch = TrainTree->
Branch(methodtitle.
Data(), &mva);
1166 tmptrain->SetBranchAddress(methodtitle.
Data(), &mva);
1167 auto entries = tmptrain->GetEntries();
1168 for (
UInt_t ev = 0; ev < entries; ev++) {
1169 tmptrain->GetEntry(ev);
1170 trainbranch->Fill();
1172 auto testbranch = TestTree->
Branch(methodtitle.
Data(), &mva);
1173 tmptest->SetBranchAddress(methodtitle.
Data(), &mva);
1174 entries = tmptest->GetEntries();
1175 for (
UInt_t ev = 0; ev < entries; ev++) {
1176 tmptest->GetEntry(ev);
1189 auto fname =
Form(
".%s%s%s.root",
fDataLoader->GetName(), methodname.Data(), methodtitle.
Data());
std::map< UInt_t, std::vector< std::tuple< Float_t, Float_t, Bool_t > > > fMvaTest
IMethod * Create(const std::string &name, const TString &job, const TString &title, DataSetInfo &dsi, const TString &option)
creates the method if needed based on the method name using the creator function the factory has stor...
static ClassifierFactory & Instance()
access to the ClassifierFactory singleton creates the instance if needed
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
void SetModelPersistence(Bool_t status)
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Bool_t IsCutsMethod(TMVA::MethodBase *method)
Allows to check if the ml method is a Cuts method.
UInt_t GetNVariables() const
#define MinNoTrainingEvents
TString GetMethodOptions(TString methodname, TString methodtitle)
return the options for the booked method.
Principal Components Analysis (PCA)
void SetNWorkers(unsigned n)
virtual TList * GetListOfKeys() const
Types::EAnalysisType fAnalysisType
vector of objects with booked methods
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
MsgLogger & Endl(MsgLogger &ml)
void Show()
Method to print the results in stdout.
DataSetInfo & GetDataLoaderDataSetInfo()
Utility method to get TMVA::DataSetInfo reference from the DataLoader.
Singleton class for Global types used by TMVA.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
virtual void Test()
Perform test evaluation in all booked methods.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Double_t GetROCIntegral(const UInt_t points=41)
Calculates the ROC integral (AUC)
void SetFile(TFile *file)
Method to set the pointer to TFile object, with a writable file.
T GetValue(const TString &key)
TString & ReplaceAll(const TString &s1, const TString &s2)
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
virtual const char * GetClassName() const
Bool_t HasMethodObject(TString methodname, TString methodtitle, Int_t &index)
Allows to check if the TMVA::MethodBase was created and return the index in the vector.
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
Double_t GetROCIntegral(UInt_t iClass=0, TMVA::Types::ETreeType type=TMVA::Types::kTesting)
Method to get ROC-Integral value from mvas.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual int MakeDirectory(const char *name)
Make a directory.
TAxis * GetYaxis() const
Get y axis of the graph.
Virtual base Class for all MVA method.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
overwrite existing object with same name
MethodBase * GetMethod(TString methodname, TString methodtitle)
Return a TMVA::MethodBase object.
virtual void SetTitle(const char *title="")
Set graph title.
UInt_t GetNClasses() const
const std::vector< Event * > & GetEventCollection(Types::ETreeType type=Types::kMaxTreeType) const
void SetSilentFile(Bool_t status)
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)=0
std::shared_ptr< TFile > fFile
data
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Copy a tree with selection.
Bool_t IsSilentFile()
Method to see if a file is available to save results.
std::map< UInt_t, std::vector< std::tuple< Float_t, Float_t, Bool_t > > > fMvaTrain
TDirectory * RootBaseDir()
Utility method to get base dir directory from current file.
Bool_t HasMethod(TString methodname, TString methodtitle)
function to check methods booked
ClassificationResult & operator=(const ClassificationResult &r)
static void InhibitOutput()
static void SetIsTraining(Bool_t)
when this static function is called, it sets the flag whether events with negative event weight shoul...
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
DataSetInfo & fDataSetInfo
virtual void SetName(const char *name="")
Set graph name.
virtual void TrainMethod(TString methodname, TString methodtitle)
Lets train an specific ml method.
virtual void ParseOptions()
options parser
Abstract base class for all high level ml algorithms, you can book ml methods like BDT...
void SetupMethod()
setup of methods
DataSetInfo & DataInfo() const
std::vector< IMethod * > fIMethods
void SetDrawProgressBar(Bool_t d)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Classification(DataLoader *loader, TFile *file, TString options)
Contructor to create a two class classifier.
Class for boosting a TMVA method.
TMatrixT< Double_t > TMatrixD
Class that contains all the data information.
virtual void ParseOptions()
Method to parse the internal option string.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void TestMethod(TString methodname, TString methodtitle)
Lets perform test an specific ml method.
Results * GetResults(const TString &, Types::ETreeType type, Types::EAnalysisType analysistype)
std::string GetMethodName(TCppMethod_t)
R__EXTERN TSystem * gSystem
virtual void AddRow(const Double_t *x)
Add a data point and update the covariance matrix.
const char * GetName() const
Long64_t GetNEvtSigTest()
return number of signal test events in dataset
A ROOT file is structured in Directories (like a file system).
Double_t GetROCIntegral(TString methodname, TString methodtitle, UInt_t iClass=0)
Method to get ROC-Integral value from mvas.
class TMVA::Config::VariablePlotting fVariablePlotting
char * Form(const char *fmt,...)
DataSetManager * fDataSetManager
const TMatrixD * GetCovarianceMatrix() const
const TString & GetMethodName() const
The ROOT global object gROOT contains a list of all defined classes.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual void MakePrincipals()
Perform the principal components analysis.
void SetBoostedMethodName(TString methodName)
Long64_t GetNEvtBkgdTest()
return number of background test events in dataset
TAxis * GetXaxis() const
Get x axis of the graph.
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
virtual void SaveSelf(Bool_t=kFALSE)
Class for categorizing the phase space.
TMVA::ROCCurve * GetROC(TMVA::MethodBase *method, UInt_t iClass=0, TMVA::Types::ETreeType type=TMVA::Types::kTesting)
Method to get TMVA::ROCCurve Object.
virtual void CheckSetup()
check may be overridden by derived class (sometimes, eg, fitters are used which can only be implement...
A pseudo container class which is a generator of indices.
Describe directory structure in memory.
Bool_t fModelPersistence
file to save the results
std::shared_ptr< DataLoader > fDataLoader
Booked method information.
void CopyFrom(TDirectory *src, TFile *file)
Class which takes the results of a multiclass classification.
void SetFile(TFile *file)
void SetCurrentType(Types::ETreeType type) const
void ProcessSetup()
process all options the "CheckForUnusedOptions" is done in an independent call, since it may be overr...
ostringstream derivative to redirect and format output
const TString & GetOptions() const
Mother of all ROOT objects.
UInt_t fJobs
procpool object
void SetUseColor(Bool_t uc)
void SetConfigName(const char *n)
Interface for all concrete MVA method implementations.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
Bool_t IsMethod(TString methodname, TString methodtitle)
Method to check if method was booked.
virtual TObject * ReadObj()
To read a TObject* from the file.
Abstract ClassifierFactory template that handles arbitrary types.
TGraph * GetROCCurve(const UInt_t points=100)
Returns a new TGraph containing the ROC curve.
DataSetManager * fDataSetManager
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
auto Map(F func, unsigned nTimes) -> std::vector< typename std::result_of< F()>::type >
Execute func (with no arguments) nTimes in parallel.
TString GetMethodTypeName() const
TFile * GetFile()
Method to get the pointer to TFile object.
TGraph * GetROCGraph(UInt_t iClass=0, TMVA::Types::ETreeType type=TMVA::Types::kTesting)
Method to get TGraph object with the ROC curve.
Class that is the base-class for a vector of result.
void SetWeightFileDir(TString fileDir)
set directory of weight file
Double_t GetSignalReferenceCut() const
DataSetManager * GetDataLoaderDataSetManager()
Utility method to get TMVA::DataSetManager pointer from the DataLoader.
A Graph is a graphics object made of two arrays X and Y with npoints each.
DataInputHandler & GetDataLoaderDataInput()
Utility method to get TMVA::DataInputHandler reference from the DataLoader.
virtual void Train()
Method to train all booked ml methods.
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
std::vector< ClassificationResult > & GetResults()
return the the vector of TMVA::Experimental::ClassificationResult objects.
A TTree object has a header with a name and a title.
virtual void Evaluate()
Method to perform Train/Test over all ml method booked.
static void EnableOutput()
const TString & GetTestvarName() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
TStopwatch fTimer
number of jobs to run some high level algorithm in parallel
std::vector< ClassificationResult > fResults
Types::EMVA GetMethodType() const
void CheckForUnusedOptions() const
checks for unused options in option string
const Event * GetEvent() const
const TString GetMethodTitle() const
std::vector< OptionMap > fMethods
TProcPool fWorkers
if true dont produce file output
const TString GetMethodName() const
virtual void SetAnalysisType(Types::EAnalysisType type)
Class that is the base-class for a vector of result.
void SetConfigDescription(const char *d)
ROCCurve * GetROC(UInt_t iClass=0, TMVA::Types::ETreeType type=TMVA::Types::kTesting)
Method to get TMVA::ROCCurve Object.
virtual void Close(Option_t *option="")
Close a file.
const char * Data() const