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 a suite of consecutive data records (TKey instances) with a well defined format.
Service class for 2-Dim 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
data
DataLoader * GetDataLoader()
Method to get the pointer to TMVA::DataLoader object.
Bool_t fModelPersistence
file to save the results
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
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 to save the trained model
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
Booked method information.
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
flag for extra information
UInt_t fJobs
procpool object
Envelope(const TString &name, DataLoader *dataloader=nullptr, TFile *file=nullptr, const TString options="")
timer to measute the time.
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 the single instance of "Types" if existing already, or create it (Singleton)
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, 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)