17 HistType htype ,
Bool_t showTarget,
Bool_t useTMVAStyle )
33 Int_t countCanvas = 0;
40 while ((key = (
TKey*)next())) {
42 if (!
TString(key->GetName()).BeginsWith(
"Method_"))
continue;
43 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
47 cout <<
"--- Plotting deviation for method: " << methodName << endl;
55 while ((titkey = (
TKey*)keyIt())) {
57 if (!
gROOT->GetClass(titkey->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
68 TString hname =
"MVA_" + methodTitle;
73 while ((dirKey = (
TKey*)dirKeyIt())){
74 if (dirKey->ReadObj()->InheritsFrom(
"TH2F")) {
75 TString s(dirKey->ReadObj()->GetName());
76 if (
s.Contains(
"_reg_") &&
77 ( (showTarget &&
s.Contains(
"_tgt")) || (!showTarget && !
s.Contains(
"_tgt")) ) &&
78 s.Contains( (htype == kCompareType ?
"train" :
"test" ))) {
79 c[countCanvas] =
new TCanvas(
Form(
"canvas%d", countCanvas+1),
80 Form(
"Regression output deviation versus %s for method: %s",
81 (showTarget ?
"target" :
"input variables"), methodName.
Data() ),
82 countCanvas*50+100, (countCanvas+1)*20,
width, (
Int_t)width*0.72 );
84 TH1*
h = (
TH1*)dirKey->ReadObj();
85 h->
SetTitle(
Form(
"Output deviation for method: %s (%s sample)",
86 hname.
Data(), (htype == kCompareType ?
"training" :
"test" )) );
94 cout <<
"plotting logo" << endl;
98 TString fname =
Form(
"%s/plots/deviation_%s_%s_%s_c%i",
101 (showTarget ?
"target" :
"vars"),
102 (htype == kCompareType ?
"training" :
"test" ), countPlots );
virtual const char * GetName() const
Returns name of object.
void imgconv(TCanvas *c, const TString &fname)
virtual TList * GetListOfKeys() const
Collectable string class.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
R__EXTERN TStyle * gStyle
TFile * OpenFile(const TString &fin)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Bool_t Contains(const char *name) const
void SetNumberContours(Int_t number=20)
Set the default number of contour levels when drawing 2-d plots.
void GetMethodTitle(TString &name, TKey *ikey)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
std::string GetMethodName(TCppMethod_t)
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
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".
Describe directory structure in memory.
static constexpr double s
void deviations(TString dataset, TString fin="TMVAReg.root", HistType htype=kMVAType, Bool_t showTarget=kTRUE, Bool_t useTMVAStyle=kTRUE)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual void Add(TObject *obj)
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual void Update()
Update canvas pad buffers.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
const char * Data() const