Logo ROOT   6.07/09
Reference Guide
Envelope.cxx
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Omar Zapata
3 
4 #include "TMVA/Envelope.h"
5 
6 #include "TMVA/Configurable.h"
7 #include "TMVA/DataLoader.h"
8 #include "TMVA/MethodBase.h"
9 #include "TMVA/OptionMap.h"
11 #include "TMVA/Types.h"
12 
13 #include "TAxis.h"
14 #include "TCanvas.h"
15 #include "TFile.h"
16 #include "TGraph.h"
17 #include "TSystem.h"
18 
19 #include <iostream>
20 
21 using namespace TMVA;
22 
23 //______________________________________________________________________________
24 Envelope::Envelope(const TString &name,DataLoader *dalaloader,TFile *file,const TString options):Configurable(options),fDataLoader(dalaloader),fFile(file),fVerbose(kFALSE)
25 {
26  SetName(name.Data());
27 }
28 
29 //______________________________________________________________________________
31 {}
32 
33 //______________________________________________________________________________
34 Bool_t Envelope::IsSilentFile(){return fFile==nullptr;}
35 
36 //______________________________________________________________________________
37 TFile* Envelope::GetFile(){return fFile.get();}
38 // TFile* Envelope::GetFile(){return fFile==nullptr?0:fFile.get();}
39 
40 //______________________________________________________________________________
41 void Envelope::SetFile(TFile *file){fFile=std::shared_ptr<TFile>(file);}
42 
43 //______________________________________________________________________________
45 
46 //______________________________________________________________________________
47 void Envelope::SetVerbose(Bool_t status){fVerbose=status;}
48 
49 //______________________________________________________________________________
51 
52 //______________________________________________________________________________
54 
55 //______________________________________________________________________________
57  fDataLoader=std::shared_ptr<DataLoader>(dalaloader) ;
58 }
59 
60 //______________________________________________________________________________
62 
63 //______________________________________________________________________________
65 
66 //______________________________________________________________________________
67 void TMVA::Envelope::BookMethod(Types::EMVA method, TString methodTitle, TString options){
68  return BookMethod(Types::Instance().GetMethodName( method ),methodTitle,options);
69 }
70 
71 //______________________________________________________________________________
72 void TMVA::Envelope::BookMethod(TString methodName, TString methodTitle, TString options){
73  fMethod["MethodName"] = methodName;
74  fMethod["MethodTitle"] = methodTitle;
75  fMethod["MethodOptions"] = options;
76 }
virtual void BookMethod(TString methodname, TString methodtitle, TString options="")
Method to book the machine learning method to perform the algorithm.
Definition: Envelope.cxx:72
Bool_t fVerbose
Definition: Envelope.h:62
~Envelope()
Default destructor.
Definition: Envelope.cxx:30
void SetFile(TFile *file)
Method to set the pointer to TFile object, with a writable file.
Definition: Envelope.cxx:41
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
Definition: Types.cxx:64
Bool_t IsModelPersistence()
Method to see if the algorithm model is saved in xml or serialized files.
Definition: Envelope.cxx:61
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:131
class to storage options for the differents methods
Definition: OptionMap.h:43
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:50
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
std::shared_ptr< TFile > fFile
Definition: Envelope.h:60
Bool_t IsSilentFile()
Method to see if a file is available to save results.
Definition: Envelope.cxx:34
DataLoader * GetDataLoader()
Method to get the pointer to TMVA::DataLoader object.
Definition: Envelope.cxx:53
const char * Data() const
Definition: TString.h:349
OptionMap fMethod
Definition: Envelope.h:58
Envelope(const TString &name, DataLoader *dataloader=nullptr, TFile *file=nullptr, const TString options="")
Constructor for the initialization of Envelopes, differents Envelopes may needs differents constructo...
Definition: Envelope.cxx:24
std::string GetMethodName(TCppMethod_t)
Definition: Cppyy.cxx:707
void SetVerbose(Bool_t status)
Method enable print extra information in the algorithms.
Definition: Envelope.cxx:47
void SetDataLoader(DataLoader *dalaloader)
Method to set the pointer to TMVA::DataLoader object.
Definition: Envelope.cxx:56
Bool_t IsVerbose()
Method to see if the algorithm should print extra information.
Definition: Envelope.cxx:44
void SetModelPersistence(Bool_t status=kTRUE)
Method enable model persistence, then algorithms model is saved in xml or serialized files...
Definition: Envelope.cxx:64
OptionMap & GetMethod()
Method get the Booked method in a option map object.
Definition: Envelope.cxx:50
Bool_t fModelPersistence
file to save the results
Definition: Envelope.h:61
std::shared_ptr< DataLoader > fDataLoader
Definition: Envelope.h:59
Abstract ClassifierFactory template that handles arbitrary types.
TFile * GetFile()
Method to get the pointer to TFile object.
Definition: Envelope.cxx:37
Definition: file.py:1
char name[80]
Definition: TGX11.cxx:109