40 #ifndef ROOT_TMVA_Factory
41 #define ROOT_TMVA_Factory
73 class DataInputHandler;
78 class VariableTransformBase;
81 class Factory :
public Configurable {
82 friend class CrossValidation;
85 typedef std::vector<IMethod*> MVector;
86 std::map<TString,MVector*> fMethodsMap;
89 Factory( TString theJobName, TFile* theTargetFile, TString theOption =
"" );
92 Factory( TString theJobName, TString theOption =
"" );
101 MethodBase* BookMethod( DataLoader *loader, TString theMethodName, TString methodTitle, TString theOption =
"" );
102 MethodBase* BookMethod( DataLoader *loader, Types::EMVA theMethod, TString methodTitle, TString theOption =
"" );
103 MethodBase* BookMethod( DataLoader *, TMVA::Types::EMVA ,
107 TString ) {
return 0; }
110 std::map<TString,Double_t> OptimizeAllMethods (TString fomType=
"ROCIntegral", TString fitType=
"FitGA");
111 void OptimizeAllMethodsForClassification(TString fomType=
"ROCIntegral", TString fitType=
"FitGA") { OptimizeAllMethods(fomType,fitType); }
112 void OptimizeAllMethodsForRegression (TString fomType=
"ROCIntegral", TString fitType=
"FitGA") { OptimizeAllMethods(fomType,fitType); }
115 void TrainAllMethods ();
116 void TrainAllMethodsForClassification(
void ) { TrainAllMethods(); }
117 void TrainAllMethodsForRegression (
void ) { TrainAllMethods(); }
120 void TestAllMethods();
123 void EvaluateAllMethods(
void );
124 void EvaluateAllVariables(DataLoader *loader, TString options =
"" );
126 TH1F* EvaluateImportance( DataLoader *loader,VIType vitype, Types::EMVA theMethod, TString methodTitle,
const char *theOption =
"" );
129 void DeleteAllMethods(
void );
132 IMethod* GetMethod(
const TString& datasetname,
const TString& title )
const;
133 Bool_t HasMethod(
const TString& datasetname,
const TString& title )
const;
135 Bool_t Verbose(
void )
const {
return fVerbose; }
136 void SetVerbose( Bool_t v=kTRUE );
142 virtual void MakeClass(
const TString& datasetname ,
const TString& methodTitle =
"" )
const;
148 void PrintHelpMessage(
const TString& datasetname ,
const TString& methodTitle =
"" )
const;
150 TDirectory* RootBaseDir() {
return (TDirectory*)fgTargetFile; }
152 Bool_t IsSilentFile()
const {
return fSilentFile;}
153 Bool_t IsModelPersistence()
const {
return fModelPersistence; }
155 Double_t GetROCIntegral(DataLoader *loader, TString theMethodName, UInt_t iClass = 0);
156 Double_t GetROCIntegral(TString datasetname, TString theMethodName, UInt_t iClass = 0);
161 TGraph* GetROCCurve(DataLoader *loader, TString theMethodName, Bool_t setTitles=kTRUE, UInt_t iClass=0);
162 TGraph* GetROCCurve(TString datasetname, TString theMethodName, Bool_t setTitles=kTRUE, UInt_t iClass=0);
165 TMultiGraph* GetROCCurveAsMultiGraph(DataLoader *loader, UInt_t iClass);
166 TMultiGraph* GetROCCurveAsMultiGraph(TString datasetname, UInt_t iClass);
169 TCanvas* GetROCCurve(DataLoader *loader, UInt_t iClass=0);
170 TCanvas* GetROCCurve(TString datasetname, UInt_t iClass=0);
178 TH1F* EvaluateImportanceShort( DataLoader *loader,Types::EMVA theMethod, TString methodTitle,
const char *theOption =
"" );
180 TH1F* EvaluateImportanceAll( DataLoader *loader,Types::EMVA theMethod, TString methodTitle,
const char *theOption =
"" );
182 TH1F* EvaluateImportanceRandom( DataLoader *loader,UInt_t nseeds, Types::EMVA theMethod, TString methodTitle,
const char *theOption =
"" );
184 TH1F* GetImportance(
const int nbits,std::vector<Double_t> importances,std::vector<TString> varNames);
187 ROCCurve *GetROC(DataLoader *loader, TString theMethodName, UInt_t iClass = 0,
188 Types::ETreeType type = Types::kTesting);
189 ROCCurve *GetROC(TString datasetname, TString theMethodName, UInt_t iClass = 0,
190 Types::ETreeType type = Types::kTesting);
192 void WriteDataInformation(DataSetInfo& fDataSetInfo);
194 void SetInputTreesFromEventAssignTrees();
196 MethodBase* BookMethodWeightfile(DataLoader *dataloader, TMVA::Types::EMVA methodType,
const TString &weightfile);
205 std::vector<TMVA::VariableTransformBase*> fDefaultTrfs;
209 TString fTransformations;
211 TString fVerboseLevel;
212 Bool_t fCorrelations;
218 Types::EAnalysisType fAnalysisType;
219 Bool_t fModelPersistence;