# Save TMVA::Reader as binary to .root file?

**URL:** <https://root-forum.cern.ch/t/save-tmva-reader-as-binary-to-root-file/37139>\
**Category:** TMVA\
**Created:** [December 10, 2019, 8:24am UTC](https://root-forum.cern.ch/t/save-tmva-reader-as-binary-to-root-file/37139 "2019-12-10T08:24:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![V.L.Ivanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/97f17d/32.png) [@V.L.Ivanov](https://root-forum.cern.ch/u/V.L.Ivanov)\
**Post date:** [December 10, 2019, 8:24am UTC](https://root-forum.cern.ch/t/save-tmva-reader-as-binary-to-root-file/37139/1 "2019-12-10T08:24:02Z")

</div>

Dear TMVA team,

I’m dealing with a set of ~4000 BDT classifiers, trained for the signal/background separation in specific angle-momenta ranges. Each time in the beginning of weights application I’m reading all the xml-files with weights (btw, 12 GB), it takes ~30 minutes.

Is it possible to save the configured Reader as a binary object to the .root file? This would accelerate the process. I didn’t find any info in the class reference or User Guide.

Thanks in advance!

---

<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:** [December 12, 2019, 6:24pm UTC](https://root-forum.cern.ch/t/save-tmva-reader-as-binary-to-root-file/37139/2 "2019-12-12T18:24:56Z")

</div>

Hi,

Unfortunately this is not supported at the moment, but it is a feature that we would like to implement. We hope we can add this feature in 6.22

Best regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![V.L.Ivanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/97f17d/32.png) [@V.L.Ivanov](https://root-forum.cern.ch/u/V.L.Ivanov)\
**Post date:** [December 14, 2019, 5:17pm UTC](https://root-forum.cern.ch/t/save-tmva-reader-as-binary-to-root-file/37139/3 "2019-12-14T17:17:29Z")

</div>

Hi, thanks for your reply,

I found in the depth of the forum [Convert format of TMVA weight file from xml to root](https://root-forum.cern.ch/t/convert-format-of-tmva-weight-file-from-xml-to-root/30047) the same issue, some collaborations have made the stuff doing xml\_2\_root\_tree conversion: [https://gitlab.cern.ch/atlas/athena/tree/master/Reconstruction/MVAUtils](https://gitlab.cern.ch/atlas/athena/tree/master/Reconstruction/MVAUtils). This is a welcome tool, hope to see it in next releases. Thanks again!
