42 fTransformations(
"I"), fSilentFile(
kFALSE), fJobs(1)
53 "Option to save the trained model in xml file or using serialization");
55 "\"Transformations=I;D;P;U;G,D\", for identity, "
56 "decorrelation, PCA, Uniform and Gaussianisation followed by "
57 "decorrelation transformations");
128 fDataLoader = std::shared_ptr<DataLoader>(dataloader);
153 BookMethod(
Types::Instance().GetMethodName(method), methodTitle, options);
164 for (
auto &meth : fMethods) {
165 if (meth.GetValue<
TString>(
"MethodName") == methodName && meth.GetValue<
TString>(
"MethodTitle") == methodTitle) {
166 Log() << kFATAL <<
"Booking failed since method with title <" << methodTitle <<
"> already exists "
167 <<
"in with DataSet Name <" << fDataLoader->GetName() <<
"> " <<
Endl;
171 fMethod[
"MethodName"] = methodName;
172 fMethod[
"MethodTitle"] = methodTitle;
173 fMethod[
"MethodOptions"] = options;
175 fMethods.push_back(fMethod);
195 DeclareOptionRef(color,
"Color",
"Flag for coloured screen output (default: True, if in batch mode: False)");
196 DeclareOptionRef(drawProgressBar,
"DrawProgressBar",
197 "Draw progress bar to display training, testing and evaluation schedule (default: True)");
198 DeclareOptionRef(silent,
"Silent",
"Batch mode: boolean silent flag inhibiting any output from TMVA after the "
199 "creation of the factory class object (default: False)");
202 CheckForUnusedOptions();
205 Log().SetMinType(kVERBOSE);
222 for (
auto &meth : fMethods) {
223 if (meth.GetValue<
TString>(
"MethodName") == methodname && meth.GetValue<
TString>(
"MethodTitle") == methodtitle)
239 if (!RootBaseDir()->GetDirectory(fDataSetInfo.
GetName()))
240 RootBaseDir()->mkdir(fDataSetInfo.
GetName());
244 RootBaseDir()->cd(fDataSetInfo.
GetName());
290 processTrfs = fTransformations;
293 std::vector<TMVA::TransformationHandler *> trfs;
297 std::vector<TString>::iterator trfsDefIt = trfsDef.begin();
298 for (; trfsDefIt != trfsDef.end(); ++trfsDefIt) {
303 Log() << kDEBUG <<
"current transformation string: '" << trfS.
Data() <<
"'" <<
Endl;
307 identityTrHandler = trfs.back();
313 std::vector<TMVA::TransformationHandler *>::iterator trfIt = trfs.begin();
315 for (; trfIt != trfs.end(); ++trfIt) {
317 (*trfIt)->SetRootDir(RootBaseDir()->GetDirectory(fDataSetInfo.
GetName()));
318 (*trfIt)->CalcTransformations(inputEvents);
320 if (identityTrHandler)
324 for (trfIt = trfs.begin(); trfIt != trfs.end(); ++trfIt)
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
Service class for 2-D histogram classes.
void SetDrawProgressBar(Bool_t d)
void SetUseColor(Bool_t uc)
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
virtual void ParseOptions()
options parser
const TString & GetOptions() const
Class that contains all the data information.
virtual const char * GetName() const
Returns name of object.
const TMatrixD * CorrelationMatrix(const TString &className) const
UInt_t GetNClasses() const
DataSet * GetDataSet() const
returns data set
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
ClassInfo * GetClassInfo(Int_t clNum) const
const std::vector< Event * > & GetEventCollection(Types::ETreeType type=Types::kMaxTreeType) const
Bool_t HasMethod(TString methodname, TString methodtitle)
function to check methods booked
~Envelope()
Default destructor.
Bool_t IsModelPersistence()
Method to see if the algorithm model is saved in xml or serialized files.
std::shared_ptr< TFile > fFile
! file to save the results
DataLoader * GetDataLoader()
Method to get the pointer to TMVA::DataLoader object.
Bool_t fModelPersistence
! flag to save the trained model
Bool_t IsSilentFile()
Method to see if a file is available to save results.
void SetDataLoader(DataLoader *dalaloader)
Method to set the pointer to TMVA::DataLoader object.
virtual void BookMethod(TString methodname, TString methodtitle, TString options="")
Method to book the machine learning method to perform the algorithm.
std::vector< OptionMap > fMethods
! Booked method information
void SetVerbose(Bool_t status)
Method enable print extra information in the algorithms.
void SetFile(TFile *file)
Method to set the pointer to TFile object, with a writable file.
Bool_t IsVerbose()
Method to see if the algorithm should print extra information.
Bool_t fVerbose
! flag for extra information
void SetModelPersistence(Bool_t status=kTRUE)
Method enable model persistence, then algorithms model is saved in xml or serialized files.
std::shared_ptr< DataLoader > fDataLoader
! data
virtual void ParseOptions()
Method to parse the internal option string.
TFile * GetFile()
Method to get the pointer to TFile object.
std::vector< OptionMap > & GetMethods()
Method get the Booked methods in a option map object.
TString fTransformations
! List of transformations to test
UInt_t fJobs
! number of jobs to run some high level algorithm in parallel
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...
void WriteDataInformation(TMVA::DataSetInfo &fDataSetInfo, TMVA::Types::EAnalysisType fAnalysisType)
method to save Train/Test information into the output file.
static void InhibitOutput()
class to storage options for the differents methods
static Types & Instance()
The single instance of "Types" if existing already, or create it (Singleton)
const char * GetName() const override
Returns name of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
create variable transformations
void CreateVariableTransforms(const TString &trafoDefinition, TMVA::DataSetInfo &dataInfo, TMVA::TransformationHandler &transformationHandler, TMVA::MsgLogger &log)
MsgLogger & Endl(MsgLogger &ml)