20 TString fname =
gROOT->GetTutorialDir() +
"/tmva/data/tmva_class_example.root";
21 if (!
gSystem->AccessPathName(fname)) {
25 std::cout <<
"ERROR: could not open data file" << fname << std::endl;
44 dataloader->
AddVariable(
"myvar1 := var1+var2",
'F');
45 dataloader->
AddVariable(
"myvar2 := var1-var2",
"Expression 2",
"",
'F');
46 dataloader->
AddVariable(
"var3",
"Variable 3",
"units",
'F');
47 dataloader->
AddVariable(
"var4",
"Variable 4",
"units",
'F');
53 dataloader->
AddSpectator(
"spec1 := var1*2",
"Spectator 1",
"units",
'F');
54 dataloader->
AddSpectator(
"spec2 := var1*3",
"Spectator 2",
"units",
'F');
69 "",
"",
"nTrain_Signal=1000:nTrain_Background=1000:SplitMode=Random:NormMode=NumEvents:!V");
76 "UseBaggedBoost:BaggedSampleFraction=0.5:nCuts=20:MaxDepth=2");
88 c->SetTitle(
"ROC-Integral Curve");
91 for (
UInt_t i = 0;
i < results.size();
i++) {
92 if (!results[
i].IsCutsMethod()) {
93 auto roc = results[
i].GetROCGraph();
94 roc->SetLineColorAlpha(
i + 1, 0.1);
99 mg->GetXaxis()->SetTitle(
" Signal Efficiency ");
100 mg->GetYaxis()->SetTitle(
" Background Rejection ");
101 c->BuildLegend(0.15, 0.15, 0.3, 0.3);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
void AddSignalTree(TTree *signal, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
void AddSpectator(const TString &expression, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0)
user inserts target in data set info
void SetBackgroundWeightExpression(const TString &variable)
void PrepareTrainingAndTestTree(const TCut &cut, const TString &splitOpt)
prepare the training and test trees -> same cuts for signal and background
void AddBackgroundTree(TTree *background, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
void AddVariable(const TString &expression, const TString &title, const TString &unit, char type='F', Double_t min=0, Double_t max=0)
user inserts discriminating variable in data set info
virtual void BookMethod(TString methodname, TString methodtitle, TString options="")
Method to book the machine learning method to perform the algorithm.
std::vector< ClassificationResult > & GetResults()
Return the vector of TMVA::Experimental::ClassificationResult objects.
virtual void Evaluate()
Method to perform Train/Test over all ml method booked.
A TMultiGraph is a collection of TGraph (or derived) objects.
A TTree represents a columnar dataset.
void classification(UInt_t jobs=4)