# TMVA

**URL:** https://root-forum.cern.ch/c/tmva/22.md

[Latest](https://root-forum.cern.ch/latest.md) · [Categories](https://root-forum.cern.ch/categories.md) · [Tags](https://root-forum.cern.ch/tags.md)

---

## [About the TMVA category](https://root-forum.cern.ch/t/about-the-tmva-category/24379)

<div class="topic-metadata">

**Author:** [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Replies:** 0

</div>

This category is to discuss about TMVA. Please post bug reports in Jira.

---

## [TMVA cannot interpret some valid RDataFrame expressions as input variables](https://root-forum.cern.ch/t/tmva-cannot-interpret-some-valid-rdataframe-expressions-as-input-variables/64963)

<div class="topic-metadata">

**Author:** [@araghav](https://root-forum.cern.ch/u/araghav)\
**Replies:** 1\
**Last updated:** [July 31, 2026, 6:26am UTC](https://root-forum.cern.ch/t/tmva-cannot-interpret-some-valid-rdataframe-expressions-as-input-variables/64963 "2026-07-31T06:26:13Z")

</div>

Hi, I am training a BDT using TMVA, and I noticed that some variables defined as RDataFrame expressions cannot be interpreted by TMVA, even though they work correctly within the RDataFrame workflow. For example, I orig…

---

## [Error in \<TBufferFile::WriteByteCount\>: bytecount too large (more than 1073741822): TMVA](https://root-forum.cern.ch/t/error-in-tbufferfile-writebytecount-bytecount-too-large-more-than-1073741822-tmva/64828)

<div class="topic-metadata">

**Author:** [@marta-ferrario](https://root-forum.cern.ch/u/marta-ferrario)\
**Replies:** 1\
**Last updated:** [May 1, 2026, 8:59am UTC](https://root-forum.cern.ch/t/error-in-tbufferfile-writebytecount-bytecount-too-large-more-than-1073741822-tmva/64828 "2026-05-01T08:59:41Z")

</div>

Hi, My name is Marta Ferrario and I am currently working on my thesis project using TMVA in Root. As a first step, I am preparing the DataLoaders to be used then to train a BDT: I split both signal and background sample…

---

## [Error about TMVA](https://root-forum.cern.ch/t/error-about-tmva/64739)

<div class="topic-metadata">

**Author:** [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Replies:** 4\
**Last updated:** [March 11, 2026, 12:51am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739 "2026-03-11T00:51:13Z")

</div>

The TMVA library is used for artificial neural network，the train file is: ROOT Version: 6.28/04 Platform: Ubuntu 20.04 Compiler: gcc 9.4.0

---

## [How to get different variable rankings for TMVA BDTG](https://root-forum.cern.ch/t/how-to-get-different-variable-rankings-for-tmva-bdtg/63658)

<div class="topic-metadata">

**Author:** [@tgosart](https://root-forum.cern.ch/u/tgosart)\
**Replies:** 3\
**Last updated:** [February 3, 2026, 7:51pm UTC](https://root-forum.cern.ch/t/how-to-get-different-variable-rankings-for-tmva-bdtg/63658 "2026-02-03T19:51:02Z")

</div>

I am currently training a BDTG with k-fold cross-validation. After all the folds are trained, I am able to get an input variable ranking that uses ‘Separation’ as the metric: : Ranking input var…

---

## [How to can I use TMVA to draw the ROC curve and compute its AUC of a discriminative variable?](https://root-forum.cern.ch/t/how-to-can-i-use-tmva-to-draw-the-roc-curve-and-compute-its-auc-of-a-discriminative-variable/64544)

<div class="topic-metadata">

**Author:** [@ammelsayed](https://root-forum.cern.ch/u/ammelsayed)\
**Replies:** 1\
**Last updated:** [December 17, 2025, 10:16am UTC](https://root-forum.cern.ch/t/how-to-can-i-use-tmva-to-draw-the-roc-curve-and-compute-its-auc-of-a-discriminative-variable/64544 "2025-12-17T10:16:32Z")

</div>

Dear experts, I’m using TMVA for training a BDTs classifier model. I noticed that after the model is ready, I can request a ROC curve of the BDTs trained and TMVA will tell me its AUC. But now I would like to know the d…

---

## [Feeding TMVA with TTrees for signal and backgrounds](https://root-forum.cern.ch/t/feeding-tmva-with-ttrees-for-signal-and-backgrounds/64537)

<div class="topic-metadata">

**Author:** [@ammelsayed](https://root-forum.cern.ch/u/ammelsayed)\
**Replies:** 2\
**Last updated:** [December 15, 2025, 11:02am UTC](https://root-forum.cern.ch/t/feeding-tmva-with-ttrees-for-signal-and-backgrounds/64537 "2025-12-15T11:02:08Z")

</div>

Dear experts, I’m using multiple root files for signal and background samples generated by Delphes. I read the files once for each process, create a corresponding TTree object, and store the variables data of interest i…

---

## [Deviations in classification output when converting XGBoost to .root](https://root-forum.cern.ch/t/deviations-in-classification-output-when-converting-xgboost-to-root/64423)

<div class="topic-metadata">

**Author:** [@lfb](https://root-forum.cern.ch/u/lfb)\
**Replies:** 2\
**Last updated:** [November 21, 2025, 1:00pm UTC](https://root-forum.cern.ch/t/deviations-in-classification-output-when-converting-xgboost-to-root/64423 "2025-11-21T13:00:52Z")

</div>

Hello ROOT enthusiasts :) I encountered an issue when converting a classifier from XGBoost python package to .root format: I trained and optimised the classifier using XGBoost. I need to apply to a lot of data in .root…

---

## [Training completed, but code exited before evaluating (test from weights?)](https://root-forum.cern.ch/t/training-completed-but-code-exited-before-evaluating-test-from-weights/64240)

<div class="topic-metadata">

**Author:** [@TJHague](https://root-forum.cern.ch/u/TJHague)\
**Replies:** 1\
**Last updated:** [September 29, 2025, 7:42am UTC](https://root-forum.cern.ch/t/training-completed-but-code-exited-before-evaluating-test-from-weights/64240 "2025-09-29T07:42:21Z")

</div>

Hello, I have a script that I am using that is truly just a minimally edited version of the example TMVAClassification.C. The only changes made were to point it to trees in some ROOT files I created for the signal and b…

---

## [Error after updating TensorFlow: module 'keras.\_tf\_keras.keras.backend' has no attribute 'set\_session](https://root-forum.cern.ch/t/error-after-updating-tensorflow-module-keras-tf-keras-keras-backend-has-no-attribute-set-session/60640)

<div class="topic-metadata">

**Author:** [@abayyari](https://root-forum.cern.ch/u/abayyari)\
**Replies:** 4\
**Last updated:** [September 2, 2025, 2:19pm UTC](https://root-forum.cern.ch/t/error-after-updating-tensorflow-module-keras-tf-keras-keras-backend-has-no-attribute-set-session/60640 "2025-09-02T14:19:43Z")

</div>

I was using TMVA and pyTMVA from my locally installed ROOT to run TensorFlow, and train models. It was working great, and I was able to apply the models using the variables in my root branches. Then I (foolishly) updated…

---

## [ROOT TMVA filling histogram error](https://root-forum.cern.ch/t/root-tmva-filling-histogram-error/63793)

<div class="topic-metadata">

**Author:** [@ahuang](https://root-forum.cern.ch/u/ahuang)\
**Replies:** 2\
**Last updated:** [June 25, 2025, 12:24am UTC](https://root-forum.cern.ch/t/root-tmva-filling-histogram-error/63793 "2025-06-25T00:24:14Z")

</div>

Hello experts, I’ve been having issues getting my TMVA BDT to work. Currently, there is a final fatal error due to the number of entries somehow being \<=0. I’ve also been having issues where certain entries are having a…

---

## [Avoid using an empty variable](https://root-forum.cern.ch/t/avoid-using-an-empty-variable/63512)

<div class="topic-metadata">

**Author:** [@martis](https://root-forum.cern.ch/u/martis)\
**Replies:** 3\
**Last updated:** [May 8, 2025, 6:45am UTC](https://root-forum.cern.ch/t/avoid-using-an-empty-variable/63512 "2025-05-08T06:45:31Z")

</div>

Hello, may be this is rather basic, but I couldn’t find a suitable answer. So, let me ask it: I want to train a BDT with a list of variable, but sometimes one of them has a flag value which means it does not have to be…

---

## [Export TMVA MLP to ONNX](https://root-forum.cern.ch/t/export-tmva-mlp-to-onnx/61781)

<div class="topic-metadata">

**Author:** [@martinh](https://root-forum.cern.ch/u/martinh)\
**Replies:** 2\
**Last updated:** [April 28, 2025, 8:38am UTC](https://root-forum.cern.ch/t/export-tmva-mlp-to-onnx/61781 "2025-04-28T08:38:28Z")

</div>

Hello! I have trained a TMVA Multilayer Perceptron (MLP) but would now like to export the trained classifier for preservation. There are extensive possibilities to import classifiers from Keras, ONNX, … to TMVA using SO…

---

## [SysError in TFile::Flush: error](https://root-forum.cern.ch/t/syserror-in-tfile-error/63365)

<div class="topic-metadata">

**Author:** [@Sadhana\_Verma](https://root-forum.cern.ch/u/Sadhana_Verma)\
**Replies:** 0\
**Last updated:** [April 12, 2025, 3:36am UTC](https://root-forum.cern.ch/t/syserror-in-tfile-error/63365 "2025-04-12T03:36:41Z")

</div>

I am running TMVA and at the end I am getting the error like the one below. What could be done to resolve it? 0%, time left: unknown 6%, time left: 0 sec 12%, time left: 0 sec 18%, time left: 0 sec 25%, time left: 0…

---

## [Evaluating multiple TMVA (pyKeras) weights using the same intree variables?](https://root-forum.cern.ch/t/evaluating-multiple-tmva-pykeras-weights-using-the-same-intree-variables/63179)

<div class="topic-metadata">

**Author:** [@abayyari](https://root-forum.cern.ch/u/abayyari)\
**Replies:** 4\
**Last updated:** [April 7, 2025, 11:25am UTC](https://root-forum.cern.ch/t/evaluating-multiple-tmva-pykeras-weights-using-the-same-intree-variables/63179 "2025-04-07T11:25:26Z")

</div>

I have trained multiple CNN models using the TMVA Classification code. I can evaluate a single CNN model weight in my code just fine, and I’m happy with the results it’s producing. I’m now trying to add multiple weights,…

---

## [Using CUDA in pyROOT](https://root-forum.cern.ch/t/using-cuda-in-pyroot/63187)

<div class="topic-metadata">

**Author:** [@Anantha\_Padmanabhan](https://root-forum.cern.ch/u/Anantha_Padmanabhan)\
**Replies:** 1\
**Last updated:** [March 22, 2025, 6:59pm UTC](https://root-forum.cern.ch/t/using-cuda-in-pyroot/63187 "2025-03-22T18:59:26Z")

</div>

Dear Experts I have installed ROOT with CUDA support. The following output proves it i guess: ╭─ WSL at    ~/root/root\_build  …

---

## ['TMVA' has no attribute 'PyMethodBase'](https://root-forum.cern.ch/t/tmva-has-no-attribute-pymethodbase/25105)

<div class="topic-metadata">

**Author:** [@Vidya\_Sagar\_V](https://root-forum.cern.ch/u/Vidya_Sagar_V)\
**Replies:** 5\
**Last updated:** [June 3, 2023, 8:12am UTC](https://root-forum.cern.ch/t/tmva-has-no-attribute-pymethodbase/25105 "2023-06-03T08:12:13Z")

</div>

When I try running ClassificaionKeras.py given in root 6.08 tutorials/ folder (also attached) I get the following output: Traceback (most recent call last): File "ClassificationKeras.py", line 15, in \<module\> TM…

---

## [Issue with Setting a Minimum Value for Input Parameters in Genetic Algorithm Training](https://root-forum.cern.ch/t/issue-with-setting-a-minimum-value-for-input-parameters-in-genetic-algorithm-training/62833)

<div class="topic-metadata">

**Author:** [@rpramanik](https://root-forum.cern.ch/u/rpramanik)\
**Replies:** 3\
**Last updated:** [February 17, 2025, 1:52pm UTC](https://root-forum.cern.ch/t/issue-with-setting-a-minimum-value-for-input-parameters-in-genetic-algorithm-training/62833 "2025-02-17T13:52:55Z")

</div>

I am using TMVA with FitMethod=GA to optimize five input parameters. I want to define both a minimum and maximum range for each parameter. When I specify only the maximum range, the training runs smoothly. However, when …

---

## [CUDA application for matrix multiplication](https://root-forum.cern.ch/t/cuda-application-for-matrix-multiplication/62542)

<div class="topic-metadata">

**Author:** [@terawatt](https://root-forum.cern.ch/u/terawatt)\
**Replies:** 1\
**Last updated:** [December 27, 2024, 5:43pm UTC](https://root-forum.cern.ch/t/cuda-application-for-matrix-multiplication/62542 "2024-12-27T17:43:10Z")

</div>

Dear colleagues, I’m looking for fast matrix multiplication technique and usage of GPU capabilities with TCuda class looks very promising. But I cannot find any example how to use this class in ROOT interpreter. When I…

---

## [Adding a new branch such that invariant mass that not exist in DelphesTree](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301)

<div class="topic-metadata">

**Author:** [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Replies:** 3\
**Last updated:** [November 30, 2024, 9:24am UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301 "2024-11-30T09:24:00Z")

</div>

Hello Dr @moneta , I use TMVA to fit input data as tree.root.the tree is Delphes .But according to the defined Branches and varaibles within headerfile (tree=Delphes) ,not all branches are exist .Another meaning if i w…

---

## [Availability of TMVA.Experimental.CreatePyTorchGenerators?](https://root-forum.cern.ch/t/availability-of-tmva-experimental-createpytorchgenerators/62197)

<div class="topic-metadata">

**Author:** [@pad](https://root-forum.cern.ch/u/pad)\
**Replies:** 3\
**Last updated:** [November 29, 2024, 9:29am UTC](https://root-forum.cern.ch/t/availability-of-tmva-experimental-createpytorchgenerators/62197 "2024-11-29T09:29:55Z")

</div>

Dear everyone, I’ve just seen this presentation “Zero-overhead training of machine learning models” which advertizes fantastic features such as TMVA.Experimental.CreatePyTorchGenerators . I’m using v6.32.04 and what I…

---

## [TMVA Reader With PyTorch CNN](https://root-forum.cern.ch/t/tmva-reader-with-pytorch-cnn/62300)

<div class="topic-metadata">

**Author:** [@Jackhammer0102](https://root-forum.cern.ch/u/Jackhammer0102)\
**Replies:** 5\
**Last updated:** [November 28, 2024, 6:24pm UTC](https://root-forum.cern.ch/t/tmva-reader-with-pytorch-cnn/62300 "2024-11-28T18:24:20Z")

</div>

Hi, ROOT experts, I have two questions, there’s this CNN tutorial: https://root.cern/doc/master/TMVA\_\_CNN\_\_Classification\_8C.html It also has a Python version: https://root.cern/doc/master/TMVA\_\_CNN\_\_Classification\_8…

---

## [TMVA code issues for fitting data using BDT](https://root-forum.cern.ch/t/tmva-code-issues-for-fitting-data-using-bdt/62198)

<div class="topic-metadata">

**Author:** [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Replies:** 23\
**Last updated:** [November 21, 2024, 3:34pm UTC](https://root-forum.cern.ch/t/tmva-code-issues-for-fitting-data-using-bdt/62198 "2024-11-21T15:34:19Z")

</div>

Hello root expert, I use TMVA code for fitting data using BDT method.I complete more 70% code steps but isssues toward me and i cant fix them especially in the end part code // Add data to the DataLoader …

---

## [Issues during a code run](https://root-forum.cern.ch/t/issues-during-a-code-run/62205)

<div class="topic-metadata">

**Author:** [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Replies:** 2\
**Last updated:** [November 12, 2024, 9:17am UTC](https://root-forum.cern.ch/t/issues-during-a-code-run/62205 "2024-11-12T09:17:50Z")

</div>

Hello @couet , I use TMVA code for fitting data using BDT method.I complete more 70% code steps but isssues toward me and i cant fix them especially in the end part code " // Add data to the DataLoader loader.AddTrai…

---

## [Issue using TMVA](https://root-forum.cern.ch/t/issue-using-tmva/62209)

<div class="topic-metadata">

**Author:** [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Replies:** 1\
**Last updated:** [November 12, 2024, 7:24am UTC](https://root-forum.cern.ch/t/issue-using-tmva/62209 "2024-11-12T07:24:40Z")

</div>

Hello @yus , I use TMVA code for fitting data using BDT method.I complete more 70% code steps but isssues toward me and i cant fix them especially in the end part code " // Add data to the DataLoader loader.AddTraini…

---

## [In TMVA cross validation, Kolmogorov-Smirnov test is 1](https://root-forum.cern.ch/t/in-tmva-cross-validation-kolmogorov-smirnov-test-is-1/61856)

<div class="topic-metadata">

**Author:** [@yhoonlee](https://root-forum.cern.ch/u/yhoonlee)\
**Replies:** 1\
**Last updated:** [October 6, 2024, 7:56am UTC](https://root-forum.cern.ch/t/in-tmva-cross-validation-kolmogorov-smirnov-test-is-1/61856 "2024-10-06T07:56:06Z")

</div>

Dear All, I want to use TMVA to do cross validation with DNN method. The code I used is attached as a file. The code runs, but strangely, the p-value is 1 in the Kolmogorov-Smirnov test. As I understand, if the Kolmo…

---

## [Problem about TMVA::Dataloader](https://root-forum.cern.ch/t/problem-about-tmva-dataloader/61645)

<div class="topic-metadata">

**Author:** [@TField](https://root-forum.cern.ch/u/TField)\
**Replies:** 3\
**Last updated:** [September 13, 2024, 8:53am UTC](https://root-forum.cern.ch/t/problem-about-tmva-dataloader/61645 "2024-09-13T08:53:38Z")

</div>

when I assign the address to store the weight file: auto dataloader\_raii = std::make\_uniqueTMVA::DataLoader(“/data03/tianye/dir/dataset100”); it will occur: Error in TFile::GetObjectChecked: The provided key name is inv…

---

## [Dataloader problem](https://root-forum.cern.ch/t/dataloader-problem/61157)

<div class="topic-metadata">

**Author:** [@TField](https://root-forum.cern.ch/u/TField)\
**Replies:** 2\
**Last updated:** [September 4, 2024, 6:24pm UTC](https://root-forum.cern.ch/t/dataloader-problem/61157 "2024-09-04T18:24:54Z")

</div>

If I add dataloader-\>AddVariable(“ru/rl\>0?1:0”,‘I’) in my TMVA program, it will occur : histograms with zero entries: 0 : 0 cannot compute separation : histograms with zero entries: 0 :…

---

## [Multiclass inference with TMVA SOFIE](https://root-forum.cern.ch/t/multiclass-inference-with-tmva-sofie/60562)

<div class="topic-metadata">

**Author:** [@scella](https://root-forum.cern.ch/u/scella)\
**Replies:** 3\
**Last updated:** [August 28, 2024, 3:34pm UTC](https://root-forum.cern.ch/t/multiclass-inference-with-tmva-sofie/60562 "2024-08-28T15:34:17Z")

</div>

Dear experts, I’m trying to use TMVA SOFIE to make inference starting from a keras (.h5) model. My model is a multiclass DNN, and the output that I expect from the inference is a vector of dimension N for each event, w…

---

## [Using rdataframes in TMVA](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569)

<div class="topic-metadata">

**Author:** [@scottmar1054](https://root-forum.cern.ch/u/scottmar1054)\
**Replies:** 2\
**Last updated:** [August 23, 2024, 7:51am UTC](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569 "2024-08-23T07:51:22Z")

</div>

I have a general question. How do I use an rdataframe as data input in TMVA? There is a tutorial for converting a rdataframe into an rtensor, but I don’t see any readily available information about inputting that rtensor…

[Next page](https://root-forum.cern.ch/c/tmva/22.md?page=1)
