Dear experts,
When I try to use RDF in PyROOT to deal with TMVA .xml file, I face a strange error that it can not find computeModel from ROOT. I find other answer in the forum using almost the same script as mine do not face the same error. I am really confused of it. Here are the error message and my script.
In addition, I am sure BDT.xml file could be read successfully because variables can be defined correctly.
raise AttributeError("Failed to get attribute {} from ROOT".format(name)) AttributeError: Failed to get attribute computeModel from ROOT
Dear @jonas ,
I use gInterpreter because I find someting wrong when directly use PyROOT, and I find instruction on the following topics “~rdataframe-and-tmva-in-pyroot/38930” “~/t/evaluating-mva-within-root-data-frame/49238/4”
Sorry for not putting the whole links because I cannot post my reply with them.
I try your advice, but still face the same problem.
Traceback (most recent call last):
File “TMVA_python.py”, line 12, in
variables = ROOT.model.GetVariableNames()
^^^^^^^^^^
File “/cvmfs/lhcbdev.cern.ch/conda/envs/default/2024-07-10_13-01/linux-64/lib/python3.12/site-packages/ROOT/_facade.py”, line 236, in _getattr
return getattr(self, name)
^^^^^^^^^^^^^^^^^^^
File “/cvmfs/lhcbdev.cern.ch/conda/envs/default/2024-07-10_13-01/linux-64/lib/python3.12/site-packages/ROOT/_facade.py”, line 164, in _fallback_getattr
raise AttributeError(“Failed to get attribute {} from ROOT”.format(name))
AttributeError: Failed to get attribute model from ROOT. Did you mean: ‘module’?
Dear @jonas ,
Thank you so much! It works now.
However, I meet a new problem that if the variables contains formula like “log(IPCHI2)”, it do not work.(IPCHI2 works).
variables = [“log(IPCHI2)”, “IPCHI2”]
The error message is
runtime_error: Unknown column: "log(IPCHI2)"
log(IPCHI2) cannot be recognized. How can I include formula into variables name?