11 TString fname =
"./tmva_class_example.root";
16 input =
TFile::Open(
"http://root.cern.ch/files/tmva_class_example.root",
"CACHEREAD");
19 std::cout <<
"ERROR: could not open data file" << std::endl;
38 dataloader->
AddVariable(
"myvar1 := var1+var2",
'F');
39 dataloader->
AddVariable(
"myvar2 := var1-var2",
"Expression 2",
"",
'F');
40 dataloader->
AddVariable(
"var3",
"Variable 3",
"units",
'F');
41 dataloader->
AddVariable(
"var4",
"Variable 4",
"units",
'F');
47 dataloader->
AddSpectator(
"spec1 := var1*2",
"Spectator 1",
"units",
'F');
48 dataloader->
AddSpectator(
"spec2 := var1*3",
"Spectator 2",
"units",
'F');
68 "AdaBoostBeta=0.5:UseBaggedBoost:BaggedSampleFraction=0.5:SeparationType=" 69 "GiniIndex:nCuts=20");
71 "UseBaggedBoost:BaggedSampleFraction=0.5:nCuts=20:MaxDepth=2");
84 for (
UInt_t i = 0; i < results.size(); i++) {
85 auto roc = results[i].GetROCGraph();
86 roc->SetLineColorAlpha(i + 1, 0.1);
90 mg->GetXaxis()->SetTitle(
" Signal Efficiency ");
91 mg->GetYaxis()->SetTitle(
" Background Rejection ");
void AddBackgroundTree(TTree *background, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void BookMethod(TString methodname, TString methodtitle, TString options="")
Method to book the machine learning method to perform the algorithm.
void SetTitle(const char *title="")
Set canvas title.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
A TMultiGraph is a collection of TGraph (or derived) objects.
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
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
static constexpr double mg
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
R__EXTERN TSystem * gSystem
char * Form(const char *fmt,...)
void SetBackgroundWeightExpression(const TString &variable)
virtual void Draw(Option_t *option="")
Draw a canvas.
void classification(UInt_t jobs=4)
virtual TLegend * BuildLegend(Double_t x1=0.3, Double_t y1=0.21, Double_t x2=0.3, Double_t y2=0.21, const char *title="", Option_t *option="")
Build a legend from the graphical objects in the pad.
std::vector< ClassificationResult > & GetResults()
A TTree object has a header with a name and a title.
virtual void Evaluate()
Virtual method to be implemented with your algorithm.
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
virtual void Close(Option_t *option="")
Close a file.