TMVA analysis example fails

Hi,

I’m using the built-in TMVA (3.9.2) library within root v5.20/00 and I am unable to run the TMVAnalysis.C example successfuly…

When executing this script:

% root -l $ROOTSYS/tmva/test/TMVAnalysis.C(“Fisher,Likelihood”)

I get the error, at the very end :
— Factory : Write Test Tree ‘TestTree’ to file
Error in TBasket::Create: Cannot create key without file

And unlike a previous post on Root forums regarding a similar error message (root.cern.ch/phpBB2/viewtopic.ph … highlight=), data seems not properly written to the output file …

With Root v5.21/04, I get strange errors like: “Error: cannot call member function without object”, all the time, for instance when running :
% root -l $ROOTSYS/tmva/test/TMVAnalysis.C(“Fisher,Likelihood”)

Any help welcome !

Thanks
Bertrand

Hi Bertrand,

concerning your second report, there was a bug in ROOT’s (or actually CINT’s) check whether a function is static of not, which was fixed only after v5.21/04 - you will have to download and build the current subversion trunk to pick it up. Or you run root -l $ROOTSYS/tmva/test/TMVAnalysis.C+(“Fisher,Likelihood”) (note the “+” at the end of the filename).

I expect the other issue will be handled by the TMVA guys.

Cheers, Axel.

PS. Corrected the location of the +

Hi Axel,

I tried with v5.21/05 but it didn’t work, I still get the error "Error: cannot call member function without object…"
I also tried adding the ‘+’ sign after the name of the file as you suggested and got a bunch of errors about objects not being declared/in scope…

Is it me or is v5.21/05 still buggy ?

Thanks,

Bertrand

Hi Bertrand,

For using ACLiC (the +), you would need to update the script to add the needed include files.
For the static object issue, I can reproduce the problem and will fix it shortly.

Cheers,
Philippe.

Hi,

It turns out that CINT in this case was 100% correct; the compilers agreed as follow:root/tmva/test/TMVAnalysis.C:121: error: cannot call member function ‘TList* TMVA::Tools::ParseFormatLine(TString, const char*)’ without object

I have corrected in the TMVAnalysis.C macro in the SVN trunk.
It now works both in compiled mode (with the +) and in interpreted mode (but this requires compiling TMVA with the head of the svn trunk).

Cheers,
Philippe.

Philippe,

I compiled the newest version of root and it works (almost) fine. I get a segmentation fault though when trying to draw correlation plots (scatter) from the GUI, for instance, after running TVMAnalysis.C, if you press on one of the buttons ‘2’ in the GUI that pops up when the script finishes…not sure if it’s me or not, can you reproduce this as well ?

Thanks,
Bertrand

I just realized that the problem (segmentation fault) only occurs in batch mode…seems to be ok in compile mode.

Hello,

I just met the problem of “Error: cannot call member function without object” and found this topic. I checked out the latest version of root. But while I run:
% root -l $ROOTSYS/tmva/test/TMVAnalysis.C.
I crushed at:

[quote]— Fisher : VerboseLevel: “Default” [Verbosity level]
— Fisher : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]
— Factory : Booking method: Fisher
— FDA : Parsing option string:
— FDA : “H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=2:UseImprove:UseMinos:SetBatch”
— FDA : The following options are set:
— FDA : - By User:
— FDA : V: “False” [Verbose mode]
— FDA : H: “True” [Print classifier-specific help message]
— FDA : Formula: “(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3” [The discrimination formula]
— FDA : ParRanges: “(-1,1);(-10,10);(-10,10);(-10,10);(-10,10)” [Parameter ranges]
— FDA : FitMethod: “MINUIT” [Optimisation Method]
— FDA : - Default:
— FDA : D: “False” [Use-decorrelated-variables flag (depreciated)]
— FDA : Normalise: “False” [Normalise input variables]
— FDA : VarTransform: “None” [Variable transformation method]
— FDA : VarTransformType: “Signal” [Use signal or background events to derive for variable transformation (the transformation is applied on both types of, course)]
— FDA : NbinsMVAPdf: “60” [Number of bins used for the PDFs of classifier outputs]
— FDA : NsmoothMVAPdf: “2” [Number of smoothing iterations for classifier PDFs]
— FDA : VerboseLevel: “Default” [Verbosity level]
— FDA : CreateMVAPdfs: “False” [Create PDFs for classifier outputs (signal and background)]
— FDA : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]
— FDA : Converger: “None” [FitMethod uses Converger to improve result]
— FDA : Formula contains expression: “x2”, which cannot be attributed to an input variable
***> abort program execution[/quote]

You know, there was no such problem for the downloaded TMVA package. Anyway, I recompiled this package with the new ROOT, the problem of “Error: cannot call member function without object” has gone, and it works well. I guess there is some difference between the TMVA in root and the package?

Thanks, Jibo

Hello,

I just want to let you know two further problems. There would be warnings if I run the following in the TMVA package:
% root -l TMVAGui.C

[quote]Error: cannot call member function without object TMVAlogon.C:17:
/data/hejb/TMVA/macros/…/lib/libTMVA.so -1 void TMVA::tools::TMVAWelcomeMessage();
Calling : TMVA::tools::TMVAWelcomeMessage();
Match rank: file line signature
ffffffff /data/hejb/TMVA/macros/…/lib/libTMVA.so -1 void TMVA::tools::TMVAWelcomeMessage(TMVA::MsgLogger&,TMVA::tools::EWelcomeMessage);

  •    0 /data/hejb/TMVA/macros/../lib/libTMVA.so  -1 void TMVA::Tools::TMVAWelcomeMessage();
    

*** Interpreter error recovered ***[/quote]

But it seems I still could click the plots and have a look.

Another problem is that there is something wrong with (8a) Network Architecture. In both cases (TMVAnalysis.C and TMVAGui.C) it would crush (and there is also a little problem with something else. I also copy them in the following:

[quote]Info in TCanvas::Print: eps file plots/BDTD_ControlPlots.eps has been created
Info in TCanvas::Print: file plots/BDTD_ControlPlots.png has been created
— Found 11 classifier types
— Found 2 instance(s) of the method Method_BDT
Error: cannot call member function without object (compiled) 0 TString& TString::operator=(const char*);
Calling : TString::operator=(char*);
Match rank: file line signature
ffffffff (compiled) 0 TString& TString::operator=(const TSubString&);
1000001 (compiled) 0 TString& TString::operator=(const string&);
1000001 (compiled) 0 TString& TString::operator=(const TString&);

  •    1 (compiled)   0 TString& TString::operator=(const char*);
    
    ffffffff (compiled) 0 TString& TString::operator=(char);
    — Found 1 instance(s) of the method Method_RuleFit
    — Found 1 instance(s) of the method Method_Cuts
    — Found 2 instance(s) of the method Method_Likelihood
    — Found 1 instance(s) of the method Method_PDERS
    — Found 1 instance(s) of the method Method_KNN
    — Found 1 instance(s) of the method Method_HMatrix
    — Found 1 instance(s) of the method Method_Fisher
    — Book canvas no: 0

— If you want to save the image as eps, gif or png, please comment out
— the corresponding lines (line no. 239-241) in tmvaglob.C


Info in TCanvas::Print: eps file plots/mva_pdf_Fisher_c1.eps has been created
Info in TCanvas::Print: file plots/mva_pdf_Fisher_c1.png has been created
— Found 1 instance(s) of the method Method_FDA
— Found 1 instance(s) of the method Method_MLP
— Found 1 instance(s) of the method Method_SVM
— Found 1 instance(s) of the method Method_RuleFit


— If you want to save the image as eps, gif or png, please comment out
— the corresponding lines (line no. 239-241) in tmvaglob.C


Info in TCanvas::Print: eps file plots/rulevisHists_RuleFit_c1.eps has been created
Info in TCanvas::Print: file plots/rulevisHists_RuleFit_c1.png has been created
— Found 1 instance(s) of the method Method_RuleFit


— If you want to save the image as eps, gif or png, please comment out
— the corresponding lines (line no. 239-241) in tmvaglob.C


Info in TCanvas::Print: eps file plots/rulevisCorr_RuleFit_c1.eps has been created
Info in TCanvas::Print: file plots/rulevisCorr_RuleFit_c1.png has been created
Error: cannot call member function without object tmvaglob.C:419:
(compiled) 0 void TString::~TString();
Calling : TString::~TString();
Match rank: file line signature

  •    0 (compiled)   0 void TString::~TString();
    

[/quote]

Thanks for reporting these issues. I will look in the issues with 8a (problem with call/using strings).

Cheers,
Philippe.

Hi,

Both problem should be fixed in the ROOT SVN trunk.

Cheers,
Philippe

Hello,

Thank you very much.

[quote=“pcanal”]
Both problem should be fixed in the ROOT SVN trunk.
Philippe[/quote]

Just now I updated the ROOT (svn up) on my laptop (ubuntu 8.10), and compiled again.
(make clean, make)
But when I run
%root -l $ROOTSYS/tmva/test/TMVAnalysis.C.

The problem is still there?

[quote]— FDA : TxtWeightFilesOnly: “True” [If True: write all training results (weights) as text files (False: some are written in ROOT format)]
— FDA : Converger: “None” [FitMethod uses Converger to improve result]
— FDA : Formula contains expression: “x2”, which cannot be attributed to an input variable[/quote]

Hi,

Yes, the problem with FDA is still there.

Cheers,
Philippe.

This is fixed now and I will send Rene an update within the next days.

Cheers,
Joerg

Hello,

I just want to let you know that the FDA problem is still present in the latest one of svn. I guess you forgot to send the update?

After commenting out FDA, there is still something wrong with
(3) Input Variable Linear Correlation Coefficients (see attached plot, the axis title on the right and the upper are not wanted).
(6) Parallel Coordinates
(8a) Network Architecture.

Could you please have a look? I run “root -l $ROOTSYS/tmva/test/TMVAnalysis.C” with ROOT 5.23.01 in Ubuntu 8.10 (64 bit).

Thanks a lot.

Cheers, Jibo