/// root -l ./TMVAClassification.C #include #include #include #include #include "TChain.h" #include "TFile.h" #include "TTree.h" #include "TString.h" #include "TObjString.h" #include "TSystem.h" #include "TROOT.h" #include "TMVA/Factory.h" #include "TMVA/DataLoader.h" #include "TMVA/Tools.h" #include "TMVA/TMVAGui.h" int TMVAClassification( TString myMethodList = "" ) { // This loads the library TMVA::Tools::Instance(); // Default MVA methods to be trained + tested std::map Use; // 1-dimensional likelihood ("naive Bayes estimator") Use["Likelihood"] = 1; Use["LikelihoodD"] = 1; // the "D" extension indicates decorrelated input variables (see option strings) Use["LikelihoodPCA"] = 0; // the "PCA" extension indicates PCA-transformed input variables (see option strings) Use["LikelihoodKDE"] = 0; Use["LikelihoodMIX"] = 0; // Boosted Decision Trees Use["BDT"] = 1; // uses Adaptive Boost Use["BDTG"] = 0; // uses Gradient Boost Use["BDTB"] = 1; // uses Bagging Use["BDTD"] = 0; // decorrelation + Adaptive Boost Use["BDTF"] = 0; // allow usage of fisher discriminant for node splitting // Mutidimensional likelihood and Nearest-Neighbour methods Use["PDERS"] = 0; Use["PDERSD"] = 0; Use["PDERSPCA"] = 0; Use["PDEFoam"] = 0; Use["PDEFoamBoost"] = 0; // uses generalised MVA method boosting Use["KNN"] = 0; // k-nearest neighbour method // Cut optimisation Use["Cuts"] = 0; Use["CutsD"] = 0; Use["CutsPCA"] = 0; Use["CutsGA"] = 0; Use["CutsSA"] = 0; // Linear Discriminant Analysis Use["LD"] = 0; // Linear Discriminant identical to Fisher Use["Fisher"] = 0; Use["FisherG"] = 0; Use["BoostedFisher"] = 0; // uses generalised MVA method boosting Use["HMatrix"] = 0; // Function Discriminant analysis Use["FDA_GA"] = 0; // minimisation of user-defined function using Genetics Algorithm Use["FDA_SA"] = 0; Use["FDA_MC"] = 0; Use["FDA_MT"] = 0; Use["FDA_GAMT"] = 0; Use["FDA_MCMT"] = 0; // Neural Networks (all are feed-forward Multilayer Perceptrons) Use["MLP"] = 1; // Recommended ANN Use["MLPBFGS"] = 0; // Recommended ANN with optional training method Use["MLPBNN"] = 0; // Recommended ANN with BFGS training method and bayesian regulator Use["CFMlpANN"] = 0; // Depreciated ANN from ALEPH Use["TMlpANN"] = 0; // ROOT's own ANN #ifdef R__HAS_TMVAGPU Use["DNN_GPU"] = 0; // CUDA-accelerated DNN training. #else Use["DNN_GPU"] = 0; #endif #ifdef R__HAS_TMVACPU Use["DNN_CPU"] = 0; // Multi-core accelerated DNN. #else Use["DNN_CPU"] = 0; #endif // // Support Vector Machine Use["SVM"] = 0; // Friedman's RuleFit method, ie, an optimised series of cuts ("rules") Use["RuleFit"] = 0; // --------------------------------------------------------------- std::cout << std::endl; std::cout << "==> Start TMVAClassification" << std::endl; // Select methods (don't look at this code - not of interest) if (myMethodList != "") { for (std::map::iterator it = Use.begin(); it != Use.end(); it++) it->second = 0; std::vector mlist = TMVA::gTools().SplitString( myMethodList, ',' ); for (UInt_t i=0; i::iterator it = Use.begin(); it != Use.end(); it++) std::cout << it->first << " "; std::cout << std::endl; return 1; } Use[regMethod] = 1; } } // -------------------------------------------------------------------------------------------------- // Here the preparation phase begins // Read training and test data // (it is also possible to use ASCII format as input -> see TMVA Users Guide) /////////////////////////////////////////////// Signal Files //////////////////////////////////////////////////////// TFile *input(0); TString fname = "/home/abdul/Software/root/tutorials/tmva/Signal_RL.root"; if (!gSystem->AccessPathName( fname )) { input = TFile::Open( fname ); // check if file in local directory exists } else { TFile::SetCacheFileDir("."); input = TFile::Open("/home/abdul/Software/root/tutorials/tmva/Signal_RL.root", "CACHEREAD"); } if (!input) { std::cout << "ERROR: could not open data file" << std::endl; exit(1); } std::cout << "--- TMVAClassification : Using input file: " << input->GetName() << std::endl; // ////////////////////////////////////////////////// Background Files /////////////////////////////////////////// TFile* data1 = new TFile("/home/abdul/Software/root/tutorials/tmva/Bkg1_ttbar.root"); TTree* data1Tree = (TTree*)(data1->Get("Tree")); TFile* data2 = new TFile("/home/abdul/Software/root/tutorials/tmva/bg2_ttz.root"); TTree* data2Tree = (TTree*)(data2->Get("Tree")); TFile* data3 = new TFile("/home/abdul/Software/root/tutorials/tmva/Bkg3_ttbarh.root"); TTree* data3Tree = (TTree*)(data3->Get("Tree")); //TFile* data4 = new TFile("/home/abdul/Software/root/tutorials/tmva/bg4_wwz.root"); //TTree* data4Tree = (TTree*)(data4->Get("Tree")); ////////////////////////////////////////////// Register the training and test trees //////////////////////////////////////////// TTree *signalTree = (TTree*)input->Get("DelphesS"); // TTree *signalTree = (TTree*)input->Get("DelphesS2"); // TTree *signalTree = (TTree*)input->Get("DelphesS3"); TTree *background1 = (TTree*)data1->Get("DelphesB1"); TTree *background2 = (TTree*)data2->Get("DelphesB2"); TTree *background3 = (TTree*)data3->Get("DelphesB3"); // TTree *background4 = (TTree*)data4->Get("DelphesB4"); // Create a ROOT output file where TMVA will store ntuples, histograms, etc. TString outfileName( "TMVA.root" ); TFile* outputFile = TFile::Open( outfileName, "RECREATE" ); TMVA::Factory *factory = new TMVA::Factory( "TMVAClassification", outputFile, "!V:!Silent:Color:DrawProgressBar:Transformations=I;D;P;G,D:AnalysisType=Classification" ); TMVA::DataLoader *dataloader=new TMVA::DataLoader("dataset"); // Add Variable which are given in Tree of root file dataloader->AddVariable( "Jet.PT", "Jet.PT","GeV", 'F' ); dataloader->AddVariable( "Jet.Eta", "Jet.Eta", 'F' ); dataloader->AddVariable( "Jet.Phi", "Jet.Phi", 'F' ); dataloader->AddVariable( "Jet.Mass", "Jet.Mass", "GeV",'F' ); dataloader->AddVariable(" MissingET.MET"," MissingET.MET","GeV",'F'); dataloader->AddVariable("@Jet.size()","@Jet.size()","GeV",'F'); dataloader->AddVariable("Jet.BTag","Jet.BTag",'F'); dataloader->AddVariable(" ScalarHT.HT"," ScalarHT.HT","GeV",'F'); dataloader->AddVariable(" Jet.DeltaEta","Jet.DeltaEta",'F'); dataloader->AddVariable(" Jet.DeltaPhi","Jet.DeltaPhi",'F'); // Add spectator vraibles which do not appear in graphs dataloader->AddSpectator( "spec1 := Jet.PT*3", "Jet.PT*3", "GeV", 'F' ); dataloader->AddSpectator( "spec2 := Jet.Eta*3", "Jet.Eta*3", 'F' ); dataloader->AddSpectator( "spec3 := Jet.Phi*3", "Jet.Phi*3", 'F' ); dataloader->AddSpectator( "spec4 := Jet.Mass*3", "Jet.Mass*3", "GeV", 'F' ); dataloader->AddSpectator( "spec5 := MissingET.MET*3", " MissingET.MET*3", "GeV", 'F' ); dataloader->AddSpectator( "spec6 := @Jet.size()*3", "@Jet.size()*3","GeV", 'F' ); dataloader->AddSpectator( "spec7 := Jet.BTag*3", "Jet.BTag*3", 'F' ); dataloader->AddSpectator( "spec8 := ScalarHT.HT*3", "ScalarHT.HT*3","GeV", 'F' ); dataloader->AddSpectator( "spec9 := Jet.DeltaEta*3", "Jet.DeltaEta*3", 'F' ); dataloader->AddSpectator( "spec10 := Jet.DeltaPhi*3", "Jet.DeltaPhi*3", 'F' ); /////////////////////////////////// // global event weights per tree (see below for setting event-wise weights) //////////////////////////////////////////////// Double_t signalWeight = 1; Double_t background1Weight = 2; Double_t background2Weight = 2; Double_t background3Weight = 2; //Double_t background4Weight = 3; // ////////////////////////////////////////////////////// You can add an arbitrary number of signal or background trees ////////////////////////////////////////// dataloader->AddSignalTree ( signalTree, signalWeight ); dataloader->AddBackgroundTree( background1, background1Weight ); dataloader->AddBackgroundTree( background2, background2Weight ); dataloader->AddBackgroundTree( background3, background3Weight ); // dataloader->AddBackgroundTree( background4, background4Weight ); dataloader->SetBackgroundWeightExpression( "Event.Weight" ); // Apply additional cuts on the signal and background samples (can be different) TCut mycuts = "abs(Jet.PT) > 30 && abs(Jet.Eta) < 2.1 || abs(Jet.Eta) > -2.1 && abs(Jet.Mass) == 500 "; // for example: TCut mycuts = "abs(var1)<0.5 && abs(var2-0.5)<1"; TCut mycutb = "abs(Jet.PT) > 30 && abs(Jet.Eta) < 2.1 || abs(Jet.Eta) > -2.1 && abs(Jet.Mass) == 500 "; // for example: TCut mycutb = "abs(var1)<0.5"; // Tell the dataloader how to use the training and testing events dataloader->PrepareTrainingAndTestTree( mycuts, "nTrain_Signal=0:nTrain_Background=0:SplitMode=Random:NormMode=NumEvents:!V" ); //////// Book MVA methods ////////// ////////////////////////////////////Likelihood Methos/////////////////////////////////////////////////////////// // Likelihood ("naive Bayes estimator") if (Use["Likelihood"]) factory->BookMethod( dataloader, TMVA::Types::kLikelihood, "Likelihood", "!H:!V:TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmoothBkg[1]=10:NSmooth=1:NAvEvtPerBin=50" ); // Decorrelated likelihood if (Use["LikelihoodD"]) factory->BookMethod( dataloader, TMVA::Types::kLikelihood, "LikelihoodD", "!H:!V:TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmooth=7:NAvEvtPerBin=50:VarTransform=Decorrelate" ); // PCA-transformed likelihood if (Use["LikelihoodPCA"]) factory->BookMethod( dataloader, TMVA::Types::kLikelihood, "LikelihoodPCA", "!H:!V:!TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmooth=7:NAvEvtPerBin=50:VarTransform=PCA" ); // Use a kernel density estimator to approximate the PDFs if (Use["LikelihoodKDE"]) factory->BookMethod( dataloader, TMVA::Types::kLikelihood, "LikelihoodKDE", "!H:!V:!TransformOutput:PDFInterpol=KDE:KDEtype=Gauss:KDEiter=Adaptive:KDEFineFactor=0.3:KDEborder=None:NAvEvtPerBin=50" ); // Use a variable-dependent mix of splines and kernel density estimator if (Use["LikelihoodMIX"]) factory->BookMethod( dataloader, TMVA::Types::kLikelihood, "LikelihoodMIX", "!H:!V:!TransformOutput:PDFInterpolSig[0]=KDE:PDFInterpolBkg[0]=KDE:PDFInterpolSig[1]=KDE:PDFInterpolBkg[1]=KDE:PDFInterpolSig[2]=Spline2:PDFInterpolBkg[2]=Spline2:PDFInterpolSig[3]=Spline2:PDFInterpolBkg[3]=Spline2:KDEtype=Gauss:KDEiter=Nonadaptive:KDEborder=None:NAvEvtPerBin=50" ); //////////////////////////////////// Multilayer Perceptrons Methods///////////////////////////////////////////////////// // TMVA ANN: MLP (recommended ANN) -- all ANNs in TMVA are Multilayer Perceptrons if (Use["MLP"]) factory->BookMethod( dataloader, TMVA::Types::kMLP, "MLP", "!H:!V:NeuronType=tanh:VarTransform=N:NCycles=600:HiddenLayers=N+5:TestRate=5:!UseRegulator" ); if (Use["MLPBFGS"]) factory->BookMethod( dataloader, TMVA::Types::kMLP, "MLPBFGS", "!H:!V:NeuronType=tanh:VarTransform=N:NCycles=600:HiddenLayers=N+5:TestRate=5:TrainingMethod=BFGS:!UseRegulator" ); // BFGS training with bayesian regulators if (Use["MLPBNN"]) factory->BookMethod( dataloader, TMVA::Types::kMLP, "MLPBNN", "!H:!V:NeuronType=tanh:VarTransform=N:NCycles=600:HiddenLayers=N+5:TestRate=5:TrainingMethod=BFGS:UseRegulator" ); /////////////////////////////////////Boost Methods////////////////////////////////////////////////// // Adaptive Boost if (Use["BDT"]) factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDT", "!H:!V:NTrees=800:MinNodeSize=2.5%:MaxDepth=3.5:BoostType=AdaBoost:AdaBoostBeta=0.5:UseBaggedBoost:BaggedSampleFraction=0.5:SeparationType=GiniIndex:nCuts=20" ); // Boosted Decision Trees // Gradient Boost if (Use["BDTG"]) factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDTG", "!H:!V:NTrees=900:MinNodeSize=2.5%:BoostType=Grad:Shrinkage=0.10:UseBaggedBoost:BaggedSampleFraction=0.5:nCuts=20:MaxDepth=2" ); // Bagging if (Use["BDTB"]) factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDTB", "!H:!V:NTrees=400:BoostType=Bagging:SeparationType=GiniIndex:nCuts=20" ); // Decorrelation + Adaptive Boost if (Use["BDTD"]) factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDTD", "!H:!V:NTrees=850:MinNodeSize=2.5%:MaxDepth=3.5:BoostType=AdaBoost:SeparationType=GiniIndex:nCuts=20:VarTransform=Decorrelate" ); // Allow Using Fisher discriminant in node splitting for (strong) linearly correlated variables if (Use["BDTF"]) factory->BookMethod( dataloader, TMVA::Types::kBDT, "BDTF", "!H:!V:NTrees=500:MinNodeSize=2.5%:UseFisherCuts:MaxDepth=3.5:BoostType=AdaBoost:AdaBoostBeta=0.5:SeparationType=GiniIndex:nCuts=20" ); //////////////////////////////////////PDERD Methods////////////////////////////////////////// //PDERSD if (Use["PDERSD"]) factory->BookMethod( dataloader, TMVA::Types::kPDERS, "PDERSD", "!H:!V:VolumeRangeMode=Adaptive:KernelEstimator=Gauss:GaussSigma=0.5:NEventsMin=400:NEventsMax=600:VarTransform=Decorrelate" ); //PDERSPCA if (Use["PDERSPCA"]) factory->BookMethod( dataloader, TMVA::Types::kPDERS, "PDERSPCA", "!H:!V:VolumeRangeMode=Adaptive:KernelEstimator=Gauss:GaussSigma=0.5:NEventsMin=400:NEventsMax=600:VarTransform=PCA" ); // Multi-dimensional likelihood estimator using self-adapting phase-space binning if (Use["PDEFoam"]) factory->BookMethod( dataloader, TMVA::Types::kPDEFoam, "PDEFoam", "!H:!V:SigBgSeparate=F:TailCut=0.001:VolFrac=0.0666:nActiveCells=500:nSampl=2000:nBin=5:Nmin=100:Kernel=None:Compress=T" ); //PDEFoamBoost if (Use["PDEFoamBoost"]) factory->BookMethod( dataloader, TMVA::Types::kPDEFoam, "PDEFoamBoost", "!H:!V:Boost_Num=30:Boost_Transform=linear:SigBgSeparate=F:MaxDepth=3.5:UseYesNoCell=T:DTLogic=MisClassificationError:FillFoamWithOrigWeights=F:TailCut=0:nActiveCells=500:nBin=20:Nmin=400:Kernel=None:Compress=T" ); // K-Nearest Neighbour classifier (KNN) if (Use["KNN"]) factory->BookMethod( dataloader, TMVA::Types::kKNN, "KNN", "!H:nkNN=20:ScaleFrac=0.8:SigmaFact=1.0:Kernel=Gaus:UseKernel=F:UseWeight=T:!Trim" ); // H-Matrix (chi2-squared) method if (Use["HMatrix"]) factory->BookMethod( dataloader, TMVA::Types::kHMatrix, "HMatrix", "!H:!V:VarTransform=None" ); // Linear discriminant (same as Fisher discriminant) if (Use["LD"]) factory->BookMethod( dataloader, TMVA::Types::kLD, "LD", "!H:!V:VarTransform=None:CreateMVAPdfs:PDFInterpolMVAPdf=Spline2:NbinsMVAPdf=50:NsmoothMVAPdf=10" ); //////////////////////////////// Fisher discriminant Methods////////////////////////////////// // Fisher discriminant (same as LD) if (Use["Fisher"]) factory->BookMethod( dataloader, TMVA::Types::kFisher, "Fisher", "!H:!V:Fisher:VarTransform=None:CreateMVAPdfs:PDFInterpolMVAPdf=Spline2:NbinsMVAPdf=50:NsmoothMVAPdf=10" ); // Fisher with Gauss-transformed input variables if (Use["FisherG"]) factory->BookMethod( dataloader, TMVA::Types::kFisher, "FisherG", "!H:!V:VarTransform=Gauss" ); // Composite classifier: ensemble (tree) of boosted Fisher classifiers if (Use["BoostedFisher"]) factory->BookMethod( dataloader, TMVA::Types::kFisher, "BoostedFisher", "!H:!V:Boost_Num=20:Boost_Transform=log:Boost_Type=AdaBoost:Boost_AdaBoostBeta=0.2:!Boost_DetailedMonitoring" ); // Function discrimination analysis (FDA) -- test of various fitters - the recommended one is Minuit (or GA or SA) if (Use["FDA_MC"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_MC", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MC:SampleSize=30000:Sigma=0.1" ); // can also use Simulated Annealing (SA) algorithm (see Cuts_SA options]) if (Use["FDA_GA"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_GA", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=GA:PopSize=100:Cycles=2:Steps=5:Trim=True:SaveBestGen=1" ); // can also use Simulated Annealing (SA) algorithm (see Cuts_SA options]) if (Use["FDA_SA"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_SA", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=SA:MaxCalls=15000:KernelTemp=IncAdaptive:InitialTemp=1e+6:MinTemp=1e-6:Eps=1e-10:UseDefaultScale" ); if (Use["FDA_MT"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_MT", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=2:UseImprove:UseMinos:SetBatch" ); if (Use["FDA_GAMT"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_GAMT", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=GA:Converger=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=0:!UseImprove:!UseMinos:SetBatch:Cycles=1:PopSize=5:Steps=5:Trim" ); if (Use["FDA_MCMT"]) factory->BookMethod( dataloader, TMVA::Types::kFDA, "FDA_MCMT", "!H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MC:Converger=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=0:!UseImprove:!UseMinos:SetBatch:SampleSize=20" ); ////////////////////////////////////////// ANN Methods ///////////////////////////////////////////////////////////// // CF(Clermont-Ferrand)ANN if (Use["CFMlpANN"]) factory->BookMethod( dataloader, TMVA::Types::kCFMlpANN, "CFMlpANN", "!H:!V:NCycles=200:HiddenLayers=N+1,N" ); // n_cycles:#nodes:#nodes:... // Tmlp(Root)ANN if (Use["TMlpANN"]) factory->BookMethod( dataloader, TMVA::Types::kTMlpANN, "TMlpANN", "!H:!V:NCycles=200:HiddenLayers=N+1,N:LearningMethod=BFGS:ValidationFraction=0.3" ); // n_cycles:#nodes:#nodes:... // RuleFit -- TMVA implementation of Friedman's method if (Use["RuleFit"]) factory->BookMethod( dataloader, TMVA::Types::kRuleFit, "RuleFit", "!H:!V:RuleFitModule=RFTMVA:Model=ModRuleLinear:MinImp=0.001:RuleMinDist=0.001:NTrees=20:fEventsMin=0.01:fEventsMax=0.5:GDTau=-1.0:GDTauPrec=0.01:GDStep=0.01:GDNSteps=10000:GDErrScale=1.02" ); // Support Vector Machine if (Use["SVM"]) factory->BookMethod( dataloader, TMVA::Types::kSVM, "SVM", "Gamma=0.25:Tol=0.001:VarTransform=Norm" ); // General layout. TString layoutString ("Layout=TANH|128,TANH|128,TANH|128,LINEAR"); // Training strategies. TString training0("LearningRate=1e-2,Momentum=0.9,Repetitions=1," "ConvergenceSteps=30,BatchSize=256,TestRepetitions=10," "WeightDecay=1e-4,Regularization=L2," "DropConfig=0.0+0.5+0.5+0.5, Multithreading=True"); TString training1("LearningRate=1e-2,Momentum=0.9,Repetitions=1," "ConvergenceSteps=20,BatchSize=256,TestRepetitions=10," "WeightDecay=1e-4,Regularization=L2," "DropConfig=0.0+0.0+0.0+0.0, Multithreading=True"); TString training2("LearningRate=1e-3,Momentum=0.9,Repetitions=1," "ConvergenceSteps=20,BatchSize=256,TestRepetitions=10," "WeightDecay=1e-4,Regularization=L2," "DropConfig=0.0+0.0+0.0+0.0, Multithreading=True"); TString trainingStrategyString ("TrainingStrategy="); trainingStrategyString += training0 + "|" + training1 + "|" + training2; // General Options. TString dnnOptions ("!H:V:ErrorStrategy=CROSSENTROPY:VarTransform=N:" "WeightInitialization=XAVIERUNIFORM"); dnnOptions.Append (":"); dnnOptions.Append (layoutString); dnnOptions.Append (":"); dnnOptions.Append (trainingStrategyString); //------------------------------------------------------------------------------------------------------------------- // Now you can tell the factory to train, test, and evaluate the MVAs // // Train MVAs using the set of training events factory->TrainAllMethods(); // Evaluate all MVAs using the set of test events factory->TestAllMethods(); // Evaluate and compare performance of all configured MVAs factory->EvaluateAllMethods(); // -------------------------------------------------------------- // Save the output outputFile->Close(); std::cout << "==> Wrote root file: " << outputFile->GetName() << std::endl; std::cout << "==> TMVAClassification is done!" << std::endl; delete factory; delete dataloader; // Launch the GUI for the root macros if (!gROOT->IsBatch()) TMVA::TMVAGui( outfileName ); return 0; } int main( int argc, char** argv ) { // Select methods (don't look at this code - not of interest) TString methodList; for (int i=1; i