# How to access the TMVA result.root by code instead of TMVA::GUI

**URL:** <https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124>\
**Category:** TMVA\
**Tags:** root\
**Created:** [March 20, 2023, 1:08am UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124 "2023-03-20T01:08:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![realTay\_John](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@realTay\_John](https://root-forum.cern.ch/u/realTay_John)\
**Post date:** [March 20, 2023, 1:08am UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/1 "2023-03-20T01:08:20Z")

</div>

Hi all,  
If there is an example of how to access the TMVA result.root by code instead of TMVA::GUI? Graphical interfaces cannot be forwarded using jumper server. So I can not get the access to the TMVA::GUI. How can I access the tmva result through codes. And I think it will be more convenience to get the output through code.

Thanks.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 20, 2023, 10:10am UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/3 "2023-03-20T10:10:08Z")

</div>

Hi @realTay_John,

Could you please be more specific on your issue? Otherwise, @moneta, our TMVA expert, will not be able to help.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![realTay\_John](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@realTay\_John](https://root-forum.cern.ch/u/realTay_John)\
**Post date:** [March 20, 2023, 1:21pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/4 "2023-03-20T13:21:06Z")

</div>

Graphical interfaces cannot be forwarded using jumper server. So I can not get the access to the TMVA::GUI. How can I access the tmva result through codes.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 20, 2023, 1:30pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/5 "2023-03-20T13:30:09Z")

</div>

@moneta should be able to help you with that.

> [@realTay\_John](#):
>
> Graphical interfaces cannot be forwarded using jumper server. So I can not get the access to the TMVA::GUI. How can I access the tmva result through codes.

Alternatively, how are you accessing the remote server? If it’s SSH, you may be able to enable X11 forwarding in order to still use the GUI, even if running on a different machine.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![realTay\_John](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@realTay\_John](https://root-forum.cern.ch/u/realTay_John)\
**Post date:** [March 20, 2023, 1:35pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/6 "2023-03-20T13:35:38Z")

</div>

Hi jalopezg,  
I access the remove(name2) server by: `ssh -J name1@hep.cn name2@cern.ch`  
And when I run command: `display` in target server, an error happens:

```auto
display: unable to open X server `' @ error/display.c/DisplayImageCommand/410.

```

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 20, 2023, 1:46pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/7 "2023-03-20T13:46:51Z")

</div>

Hi,  
You can access all the GUI functions with code. What is beinh the GUI are just some functions defined in [root/tmva/tmvagui/inc/TMVA at master · root-project/root · GitHub](https://github.com/root-project/root/tree/master/tmva/tmvagui/inc/TMVA) .  
These two notebooks are an example on how to do this:

- [tmva-tutorial/TMVAGuiPlots.ipynb at master · lmoneta/tmva-tutorial · GitHub](https://github.com/lmoneta/tmva-tutorial/blob/master/notebooks/TMVAGuiPlots.ipynb)
- [tmva-tutorial/TMVAGuiROC.ipynb at master · lmoneta/tmva-tutorial · GitHub](https://github.com/lmoneta/tmva-tutorial/blob/master/notebooks/TMVAGuiROC.ipynb)

If you have further questions, please let me know

Lorenzo

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 20, 2023, 1:47pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/8 "2023-03-20T13:47:17Z")

</div>

> [@realTay\_John](#):
>
> I access the remove(name2) server by: `ssh -J name1@hep.cn name2@cern.ch`

I’m not sure as to whether X11 forwarding is supported in conjunction with the `-J` option, but perhaps you can do `$ ssh -X -J name1@hep.cn name2@cern.ch`.  
Otherwise, you should be able to do it (provided that it is allowed by the remote end), a single step at a time, i.e. first by issuing `$ ssh -X name@hep.cn`, and afterward `$ ssh -X name2@cern.ch`.

Also, read @moneta reply above.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![realTay\_John](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@realTay\_John](https://root-forum.cern.ch/u/realTay_John)\
**Post date:** [March 20, 2023, 1:48pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/9 "2023-03-20T13:48:25Z")

</div>

Hi@moneta,  
That is what I want, that’s very fine for me!  
Thanks you.  
😘  
Best regards

---

<div class="post-metadata">

**Author:** ![realTay\_John](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@realTay\_John](https://root-forum.cern.ch/u/realTay_John)\
**Post date:** [March 20, 2023, 1:51pm UTC](https://root-forum.cern.ch/t/how-to-access-the-tmva-result-root-by-code-instead-of-tmva-gui/54124/10 "2023-03-20T13:51:52Z")

</div>

Hi jalopezg,

The -X option also works!  
Thanks for your nice help. 🥳 😘

Best regards!
