39 fTransformations(
"I"), fSilentFile(
kFALSE), fJobs(1)
50 "Option to save the trained model in xml file or using serialization");
52 "\"Transformations=I;D;P;U;G,D\", for identity, " 53 "decorrelation, PCA, Uniform and Gaussianisation followed by " 54 "decorrelation transformations");
123 fDataLoader=std::shared_ptr<DataLoader>(dalaloader) ;
159 for (
auto &meth : fMethods) {
160 if (meth.GetValue<TString>(
"MethodName") == methodName && meth.GetValue<TString>(
"MethodTitle") == methodTitle) {
161 Log() << kFATAL <<
"Booking failed since method with title <" << methodTitle <<
"> already exists " 162 <<
"in with DataSet Name <" << fDataLoader->GetName() <<
"> " <<
Endl;
166 fMethod[
"MethodName"] = methodName;
167 fMethod[
"MethodTitle"] = methodTitle;
168 fMethod[
"MethodOptions"] = options;
170 fMethods.push_back(fMethod);
190 DeclareOptionRef(color,
"Color",
"Flag for coloured screen output (default: True, if in batch mode: False)");
191 DeclareOptionRef(drawProgressBar,
"DrawProgressBar",
192 "Draw progress bar to display training, testing and evaluation schedule (default: True)");
193 DeclareOptionRef(silent,
"Silent",
"Batch mode: boolean silent flag inhibiting any output from TMVA after the " 194 "creation of the factory class object (default: False)");
197 CheckForUnusedOptions();
200 Log().SetMinType(kVERBOSE);
217 for (
auto &meth : fMethods) {
218 if (meth.GetValue<TString>(
"MethodName") == methodname && meth.GetValue<TString>(
"MethodTitle") == methodtitle)
234 if (!RootBaseDir()->GetDirectory(fDataSetInfo.
GetName()))
235 RootBaseDir()->mkdir(fDataSetInfo.
GetName());
239 RootBaseDir()->cd(fDataSetInfo.
GetName());
251 TString(
"Correlation Matrix (") + fDataSetInfo.
GetClassInfo(cls)->
GetName() + TString(
")"));
282 TString processTrfs =
"I";
285 processTrfs = fTransformations;
288 std::vector<TMVA::TransformationHandler *> trfs;
292 std::vector<TString>::iterator trfsDefIt = trfsDef.begin();
293 for (; trfsDefIt != trfsDef.end(); trfsDefIt++) {
295 TString trfS = (*trfsDefIt);
298 Log() << kDEBUG <<
"current transformation string: '" << trfS.Data() <<
"'" <<
Endl;
301 if (trfS.BeginsWith(
'I'))
302 identityTrHandler = trfs.back();
308 std::vector<TMVA::TransformationHandler *>::iterator trfIt = trfs.begin();
310 for (; trfIt != trfs.end(); trfIt++) {
312 (*trfIt)->SetRootDir(RootBaseDir()->GetDirectory(fDataSetInfo.
GetName()));
313 (*trfIt)->CalcTransformations(inputEvents);
315 if (identityTrHandler)
319 for (trfIt = trfs.begin(); trfIt != trfs.end(); trfIt++)
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.
virtual void BookMethod(TString methodname, TString methodtitle, TString options="")
Method to book the machine learning method to perform the algorithm.
MsgLogger & Endl(MsgLogger &ml)
Bool_t fVerbose
flag to save the trained model
~Envelope()
Default destructor
void SetFile(TFile *file)
Method to set the pointer to TFile object, with a writable file.
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
Bool_t IsModelPersistence()
Method to see if the algorithm model is saved in xml or serialized files.
TString fTransformations
flag for extra information
virtual void SetName(const char *name)
Set the name of the TNamed.
class to storage options for the differents methods
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
void WriteDataInformation(TMVA::DataSetInfo &fDataSetInfo, TMVA::Types::EAnalysisType fAnalysisType)
method to save Train/Test information into the output file.
UInt_t GetNClasses() const
const std::vector< Event * > & GetEventCollection(Types::ETreeType type=Types::kMaxTreeType) const
std::shared_ptr< TFile > fFile
data
Bool_t IsSilentFile()
Method to see if a file is available to save results
std::vector< OptionMap > & GetMethods()
Method get the Booked methods in a option map object.
DataLoader * GetDataLoader()
Method to get the pointer to TMVA::DataLoader object.
Bool_t HasMethod(TString methodname, TString methodtitle)
function to check methods booked
static void InhibitOutput()
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
Envelope(const TString &name, DataLoader *dataloader=nullptr, TFile *file=nullptr, const TString options="")
timer to measute the time.
virtual void ParseOptions()
options parser
void SetDrawProgressBar(Bool_t d)
Class that contains all the data information.
void CreateVariableTransforms(const TString &trafoDefinition, TMVA::DataSetInfo &dataInfo, TMVA::TransformationHandler &transformationHandler, TMVA::MsgLogger &log)
virtual void ParseOptions()
Method to parse the internal option string.
std::string GetMethodName(TCppMethod_t)
Service class for 2-Dim histogram classes.
void SetVerbose(Bool_t status)
Method enable print extra information in the algorithms.
ClassInfo * GetClassInfo(Int_t clNum) const
const TMatrixD * CorrelationMatrix(const TString &className) const
void SetDataLoader(DataLoader *dalaloader)
Method to set the pointer to TMVA::DataLoader object.
Bool_t IsVerbose()
Method to see if the algorithm should print extra information.
void SetModelPersistence(Bool_t status=kTRUE)
Method enable model persistence, then algorithms model is saved in xml or serialized files...
Bool_t fModelPersistence
file to save the results
std::shared_ptr< DataLoader > fDataLoader
Booked method information.
virtual const char * GetName() const
Returns name of object.
const TString & GetOptions() const
UInt_t fJobs
procpool object
void SetUseColor(Bool_t uc)
Abstract ClassifierFactory template that handles arbitrary types.
TFile * GetFile()
Method to get the pointer to TFile object.
DataSet * GetDataSet() const
returns data set
std::vector< OptionMap > fMethods