I am developing a Python (3) package to manage inputs and booking of different MVA suites and methods etc.
I am seeing a problem with the TMVA stdout, namely it doesn’t get printed out to screen even if the proper options of the TMVA factory and method objects seem to be set correctly.
This is a bit unfortunate, as I don’t know of another way of getting important info such as variable ranking other than looking at the std out (if there are, please tell me!).
Here’s a link to my package, with instructions on how to install it locally (NB: requires Python3.6+ and ROOT v6.14.04) and try to run TMVA on two sample files, also included. Look at README.rst
(approx size 120 MB)
Many thanks for the help.
One thing I can see that could possibly interfere is that you silence all logging up to warning. A lot of TMVA information is printed at the info level and could be suppressed by this.
Otherwise, the TMVA output should end up in the stdout output stream.
Another thing, I would love to hear about your experience with the tmva cross validation interface.
I tried to comment out the ROOT msg suppression calls, but the problem is still there.
I have found a hack to force the output to be produced though: I noticed that w/ my code configuration, the only TMVA output messages that get printed are the ones in https://github.com/root-project/root/blob/v6-14-04/tmva/tmva/src/Factory.cxx#L2018
So, I have added the following two calls before the training routine of the factory is invoked:
et voila’, the output is there! Now the question is: why was it necessary? I am very puzzled…
On a different note, are the calls to:
needed at all? I found them in the tutorial for Keras classification: https://github.com/root-project/root/blob/v6-14-04/tutorials/tmva/keras/ClassificationKeras.py#L12
Glad you found a solution. That should not be neccessary. My suspicion is that there is some call somewhere that suppresses the output and the solution you present forces a re-enable.
On the different note: I think the calls can be removed. The
PyInitialize should be called automatically when needed as a method from PyMVA is created. Likewise for the tools singleton object, it should also be created as needed.
Maybe @swunsch can give some more insight in the
Hi Marco, hi Kim,
Up to now, the call
TMVA.PyMethodBase.PyInitialize() is needed because the PyMVA library is loaded just on demand. If you don’t invoke this first, the PyMVA methods won’t be found by the factory, e.g., the PyKeras method is not “in the list of methods”.