I would like to use RDataFrame to evaluate my MVA model. There are amazing tutorial shows how to apply with the modern interfaces models saved in TMVA XML files.
The example works perfectly, but when I try to use my xml weights file it crashes:
<FATAL> : The expression declared to the Reader needs to be checked (name or order are wrong)
***> abort program execution
I’m happy that you found the new reader interface and you like it! However, disclaimer: it’s still in experimental stage and ought to be made accessible for productive use with ROOT 6.20 (somewhen end of the year).
But I’m going to look in the issue tomorrow and debug the cause
Aaaaand we plan to add nicer python bindings understanding for example numpy arrays natively.
You have used expressions in the training and the reader has to be booked with the exact same expressions, otherwise the setup fails. Little bit strange since the information about the expressions are not of any interest for the reader (?) Unfortunately, I haven’t thought of this in the current implementation.
As long as you don’t compile ROOT by yourself, the fix won’t propagate easily/quickly to you, but the changes are only a few lines (see the PR above).
Or if you prefer the hacky fix, just change the XML config so that the TMVA::Reader does not complain anymore (see the changed Expression and Title fields):
And I should point out that the old TMVA::Reader is not thread-safe. Therefore, we put guards around the Reader::GetMVAValue calls so that you won’t see wrong results (or a segfault) at runtime. Unfortunately, this has the implication that you cannot use multi-threading effectively.