31 while ((key = (
TKey *)keys_dir())) {
50 Int_t countCanvas = 0;
55 while ((key = (
TKey*)next())) {
57 if (!
TString(key->GetName()).BeginsWith(
"Method_"))
continue;
58 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
67 while ((titkey = (
TKey*)keyIt())) {
69 if (!
gROOT->GetClass(titkey->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
75 cout <<
"--- Found directory for method: " << methodName <<
"::" << methodTitle << endl;
76 TString hname =
"MVA_" + methodTitle;
77 for(
UInt_t icls = 0; icls < classnames.size(); ++icls){
80 std::vector<TString>::iterator classiter = classnames.
begin();
81 for(; classiter!=classnames.end(); ++classiter){
83 +
"_prob_for_" + *classiter);
86 cout <<
":\t mva distribution not available (this is normal for Cut classifier)" << endl;
94 ((
TH1*)hists.
First())->SetTitle(
Form(
"TMVA response for classifier: %s", methodTitle.
Data() ));
98 TString ctitle = ((htype == kMVAType) ?
99 Form(
"TMVA response for class %s %s", classnames.at(icls).Data(),methodTitle.
Data()) :
100 Form(
"TMVA comparison for class %s %s", classnames.at(icls).Data(),methodTitle.
Data())) ;
102 c =
new TCanvas(
Form(
"canvas%d", countCanvas+1), ctitle,
103 countCanvas*50+200, countCanvas*20, width, (
Int_t)width*0.78 );
113 if(((
TH1*)hists[i])->GetMaximum() > histmax)
114 histmax = ((
TH1*)hists[i])->GetMaximum();
121 Float_t maxMult = (htype == kCompareType) ? 1.3 : 1.2;
130 frame->
GetXaxis()->
SetTitle( methodTitle +
" response for "+classnames.at(icls));
144 classiter = classnames.begin();
152 legend->
Draw(
"same");
157 ((
TH1*)hists[i])->Draw(
"histsame");
159 ((
TH1*)hists[i])->GetYaxis()->SetTitle( ytit );
164 if (htype == kCompareType) {
168 classiter = classnames.begin();
169 for(; classiter!=classnames.end(); ++classiter){
171 +
"_prob_for_" + *classiter);
174 cout <<
":\t comparison histogram for overtraining check not available!" << endl;
185 classiter = classnames.begin();
187 legend2->
AddEntry(((
TH1*)othists[i]),*classiter+
" (training sample)",
"P");
190 legend2->
Draw(
"same");
195 if(((
TH1*)othists[i])->GetMaximum() > histmax)
196 histmax = ((
TH1*)othists[i])->GetMaximum();
201 Int_t col = ((
TH1*)hists[i])->GetLineColor();
202 ((
TH1*)othists[i])->SetMarkerSize( 0.7 );
203 ((
TH1*)othists[i])->SetMarkerStyle( 20 );
204 ((
TH1*)othists[i])->SetMarkerColor( col );
205 ((
TH1*)othists[i])->SetLineWidth( 1 );
206 ((
TH1*)othists[i])->Draw(
"e1same");
209 ymax = histmax*maxMult;
215 ((
TH1*)hists[i])->SetLineWidth( 1 );
221 cout <<
"--- Perform Kolmogorov-Smirnov tests" << endl;
222 cout <<
"--- Goodness of consistency for class " << classnames.at(icls)<< endl;
225 Float_t kol = ((
TH1*)hists[j])->KolmogorovTest(((
TH1*)othists[j]),
"X");
226 cout << classnames.at(j) <<
": " << kol << endl;
239 frame->
Draw(
"sameaxis");
262 else if (htype == kCompareType)
TMVAGlob::imgconv( c,
Form(
"%s/plots/overtrain_%s_%s",dataset.
Data(),classnames.at(icls).Data(), methodTitle.
Data()) );
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetName() const
Returns name of object.
void imgconv(TCanvas *c, const TString &fname)
Float_t GetLeftMargin() const
virtual TList * GetListOfKeys() const
This class displays a legend box (TPaveText) containing several legend entries.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
TFile * OpenFile(const TString &fin)
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
std::vector< TString > GetClassNames(TDirectory *dir)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void NormalizeHist(TH1 *h)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
void SetMargin(Float_t margin)
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
void GetMethodTitle(TString &name, TKey *ikey)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
void SetMultiClassStyle(TObjArray *hists)
TObject * First() const
Return the object in the first slot.
std::string GetMethodName(TCppMethod_t)
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Int_t GetEntriesFast() const
char * Form(const char *fmt,...)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
Mother of all ROOT objects.
Float_t GetTopMargin() const
virtual void Update()
Update canvas pad buffers.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
Float_t GetRightMargin() const
virtual void SetBorderSize(Int_t bordersize=4)
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
void mvasMulticlass(TString dataset, TString fin="TMVAMulticlass.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)
const char * Data() const