22 TIter next( TMVAMultiClassGui_keyContent );
24 while ((key = (
TKey*)next())) {
35 cbar->
AddButton( title, macro, comment, buttonType );
38 if (requiredKey !=
"") {
40 TIter next( TMVAMultiClassGui_keyContent );
42 while ((key = (
TKey*)next())) {
45 if (!found) TMVAMultiClassGui_inactiveButtons.push_back( title );
58 gROOT->SetMacroPath(curMacroPath+
":./:$ROOTSYS/tmva/test/:");
71 std::cout <<
"--- Launch TMVA GUI to view input file: " << fName << std::endl;
74 TMVAMultiClassGui_inactiveButtons.clear();
79 std::cout <<
"==> Abort TMVAMultiClassGui, please verify filename" << std::endl;
85 cout <<
"==> Abort TMVAGui, please verify if dataset exist" << endl;
107 bar->
AddButton(
"Quit",
".q",
"Quit",
"button");
112 gROOT->SaveContext();
122 TString defaultRequiredClassifier =
"";
128 TControlBar* cbar =
new TControlBar(
"vertical",
"TMVA Plotting Macros for Multiclass Classification", 0, 0 );
130 const TString buttonType(
"button" );
142 TString title =
Form(
"Input variables '%s'-transformed (training sample)",
144 if (tmp.
Contains(
"Id" )) title =
"Input variables (training sample)";
146 Form(
"(%i%c) %s", ic, ch++, title.
Data() ),
147 Form(
"TMVA::variablesMultiClass(\"%s\",\"%s\",\"%s\",\"%s\")",dataset.
Data(), fName, str->
GetString().
Data(), title.
Data() ),
148 Form(
"Plots all '%s'-transformed input variables (macro variablesMultiClass(...))", str->
GetString().
Data() ),
154 it.
Reset(); ch =
'a';
157 TString title =
Form(
"Input variable correlations '%s'-transformed (scatter profiles)",
159 if (tmp.
Contains(
"Id" )) title =
"Input variable correlations (scatter profiles)";
161 Form(
"(%i%c) %s", ic, ch++, title.
Data() ),
162 Form(
"TMVA::CorrGuiMultiClass(\"%s\",\"%s\",\"%s\",\"%s\")",dataset.
Data() , fName, str->
GetString().
Data(), title.
Data() ),
163 Form(
"Plots all correlation profiles between '%s'-transformed input variables (macro CorrGuiMultiClass(...))",
170 title =
Form(
"(%i) Input Variable Linear Correlation Coefficients", ++ic );
173 Form(
"TMVA::correlationsMultiClass(\"%s\",\"%s\")",dataset.
Data(), fName ),
174 "Plots signal and background correlation summaries for all input variables (macro correlationsMultiClass.cxx)",
177 title =
Form(
"(%ia) Classifier Output Distributions (test sample)", ++ic );
180 Form(
"TMVA::mvasMulticlass(\"%s\",\"%s\",TMVA::kMVAType)",dataset.
Data() , fName ),
181 "Plots the output of each classifier for the test data (macro mvas(...,0))",
182 buttonType, defaultRequiredClassifier );
184 title =
Form(
"(%ib) Classifier Output Distributions (test and training samples superimposed)", ic );
187 Form(
"TMVA::mvasMulticlass(\"%s\",\"%s\",TMVA::kCompareType)",dataset.
Data(), fName ),
188 "Plots the output of each classifier for the test (histograms) and training (dots) data (macro mvas(...,3))",
189 buttonType, defaultRequiredClassifier );
214 title =
Form(
"(%i) Classifier Backgr. Rej. vs Sig. Eff. (1-vs-rest ROC curves)", ++ic);
216 cbar, title,
Form(
"TMVA::efficienciesMulticlass1vsRest(\"%s\", \"%s\")", dataset.
Data(), fName),
217 "Plots background rejection vs signal efficiencies (macro efficienciesMulticlass.cxx) [\"ROC\" stands " 218 "for \"Receiver Operation Characteristics\"]",
219 buttonType, defaultRequiredClassifier);
228 title =
Form(
"(%i) Classifier Backgr. Rej. vs Sig. Eff. (1-vs-1 ROC curves)", ++ic);
230 cbar, title,
Form(
"TMVA::efficienciesMulticlass1vs1(\"%s\", \"%s\")", dataset.
Data(), fName),
231 "Plots background rejection vs signal efficiencies (macro efficienciesMulticlass.cxx) [\"ROC\" stands " 232 "for \"Receiver Operation Characteristics\"]",
233 buttonType, defaultRequiredClassifier);
271 title =
Form(
"(%ia) Network Architecture (MLP)", ++ic );
272 TString call =
Form(
"TMVA::network(\"%s\",\"%s\")",dataset.
Data() , fName );
276 "Plots the MLP weights (macro network.cxx)",
279 title =
Form(
"(%ib) Network Convergence Test (MLP)", ic );
282 Form(
"TMVA::annconvergencetest(\"%s\",\"%s\")",dataset.
Data() , fName ),
283 "Plots error estimator versus training epoch for training and test samples (macro annconvergencetest.cxx)",
286 title =
Form(
"(%i) Decision Trees (BDT)", ++ic );
289 Form(
"TMVA::BDT(\"%s\",\"%s\")",dataset.
Data() , fName ),
290 "Plots the Decision Trees trained by BDT algorithms (macro BDT(itree,...))",
302 title =
Form(
"(%i) Plot Foams (PDEFoam)", ++ic );
305 Form(
"TMVA::PlotFoams(\"%s/weights/TMVAMulticlass_PDEFoam.weights_foams.root\")",dataset.
Data()),
306 "Plot Foams (macro PlotFoams.cxx)",
307 buttonType,
"PDEFoam" );
318 cbar->
AddButton(
Form(
"(%i) Quit", ++ic ),
".q",
"Quit", buttonType );
330 for (
UInt_t i=0; i<TMVAMultiClassGui_inactiveButtons.size(); i++) cbar->
SetButtonState( TMVAMultiClassGui_inactiveButtons[i], 3 );
331 if (TMVAMultiClassGui_inactiveButtons.size() > 0) {
332 std::cout <<
"=== Note: inactive buttons indicate that the corresponding classifiers were not trained ===" << std::endl;
335 gROOT->SaveContext();
void Show()
Show control bar.
virtual const char * GetName() const
Returns name of object.
void AddButton(TControlBarButton *button)
Add button.
static std::vector< TString > TMVAMultiClassGui_inactiveButtons
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
void SetTextColor(const char *colorName)
Sets text color for control bar buttons, e.g.
Collectable string class.
void MultiClassActionButton(TControlBar *cbar, const TString &title, const TString ¯o, const TString &comment, const TString &buttonType, TString requiredKey="")
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Int_t GetEntries() const
static constexpr double bar
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
TList * MultiClassGetKeyList(const TString &pattern)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
void TMVAMultiClassGui(const char *fName="TMVAMulticlass.root", TString dataset="")
Book space in a file, create I/O buffers, to fill them, (un)compress them.
void SetButtonWidth(UInt_t width)
Sets the width in pixels for control bar button.
const TString & GetString() const
R__EXTERN TSystem * gSystem
void SetScreenFactor(Float_t factor=1)
char * Form(const char *fmt,...)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
static TList * TMVAMultiClassGui_keyContent
virtual const char * GetIncludePath()
Get the list of include path.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void Add(TObject *obj)
virtual TList * GetListOfKeys() const
void AddSeparator()
Add separator.
void Reset()
Reset list iterator.
void SetButtonState(const char *label, Int_t state=0)
Sets a state for control bar button 'label'; possible states are 0-kButtonUp, 1-kButtonDown, 2-kButtonEngaged, 3-kButtonDisabled,.
Bool_t IsWhitespace() const
virtual void SetIncludePath(const char *includePath)
IncludePath should contain the list of compiler flags to indicate where to find user defined header f...
virtual void Close(Option_t *option="")
Close a file.
const char * Data() const