# TMVA

**URL:** https://root-forum.cern.ch/c/tmva/22.md?page=5

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

**Page:** 6

---

## [TMVAGUI ROC curve range](https://root-forum.cern.ch/t/tmvagui-roc-curve-range/28500)

<div class="topic-metadata">

**Author:** [@mesmeriza](https://root-forum.cern.ch/u/mesmeriza)\
**Replies:** 12\
**Last updated:** [July 24, 2022, 3:28am UTC](https://root-forum.cern.ch/t/tmvagui-roc-curve-range/28500 "2022-07-24T03:28:43Z")

</div>

Hi guys! I am new to TMVA and I played around a bit with the TMVA GUI and I noticed that the y-axis (background rejection) is not plotted from 0 to 1, but from 0.2 to 1 … How can I change this range? Is it just a matter…

---

## [Evaluating pytorch .pt model with TMVA::Reader](https://root-forum.cern.ch/t/evaluating-pytorch-pt-model-with-tmva-reader/50647)

<div class="topic-metadata">

**Author:** [@Sam\_Bein](https://root-forum.cern.ch/u/Sam_Bein)\
**Replies:** 2\
**Last updated:** [July 4, 2022, 11:28am UTC](https://root-forum.cern.ch/t/evaluating-pytorch-pt-model-with-tmva-reader/50647 "2022-07-04T11:28:59Z")

</div>

After following the PyTorch tutorial\[1\], I’m wondering about the recommended way to evaluate a pre-made .pt file using TMVA, e.g., that someone has trained independently of ROOT. I’d like to pick up the model.pt and use …

---

## [ValueError: \`logits\` and \`labels\` must have the same shape, received ((None, 1) vs (None, 2))](https://root-forum.cern.ch/t/valueerror-logits-and-labels-must-have-the-same-shape-received-none-1-vs-none-2/50506)

<div class="topic-metadata">

**Author:** [@conrado99](https://root-forum.cern.ch/u/conrado99)\
**Replies:** 2\
**Last updated:** [June 22, 2022, 1:39pm UTC](https://root-forum.cern.ch/t/valueerror-logits-and-labels-must-have-the-same-shape-received-none-1-vs-none-2/50506 "2022-06-22T13:39:30Z")

</div>

Hi, I’m training two networks with PyKeras and i obtain an error: ValueError: logitsandlabels must have the same shape, received ((None, 1) vs (None, 2)) when i define my model such as: model = Sequential() model.add(…

---

## [Inference with TMVA::Reader is very slow when using DNN](https://root-forum.cern.ch/t/inference-with-tmva-reader-is-very-slow-when-using-dnn/50424)

<div class="topic-metadata">

**Author:** [@ebachman](https://root-forum.cern.ch/u/ebachman)\
**Replies:** 5\
**Last updated:** [June 21, 2022, 5:24pm UTC](https://root-forum.cern.ch/t/inference-with-tmva-reader-is-very-slow-when-using-dnn/50424 "2022-06-21T17:24:41Z")

</div>

Dear TMVA experts, I trained both a BDT and a DNN (using the PyKeras method) for binary classification with the TMVA::Factory class. The time it took for training and evaluation was reasonable for both methods (a few mi…

---

## [\<BookMVA\> fatal error: unable to open input weight file](https://root-forum.cern.ch/t/bookmva-fatal-error-unable-to-open-input-weight-file/50442)

<div class="topic-metadata">

**Author:** [@conrado99](https://root-forum.cern.ch/u/conrado99)\
**Replies:** 5\
**Last updated:** [June 17, 2022, 5:59pm UTC](https://root-forum.cern.ch/t/bookmva-fatal-error-unable-to-open-input-weight-file/50442 "2022-06-17T17:59:21Z")

</div>

Hi, i’ve trained a dnn\_cpu with TMVAClassification.C tutorial. But when i try to read the weights.xlm file on my c++ program to use the trained network, i obtain the following error: \<FATAL\> : \<…

---

## [How to use "GetROCCurve" with an existing loader folder](https://root-forum.cern.ch/t/how-to-use-getroccurve-with-an-existing-loader-folder/50109)

<div class="topic-metadata">

**Author:** [@Jackhammer0102](https://root-forum.cern.ch/u/Jackhammer0102)\
**Replies:** 10\
**Last updated:** [June 17, 2022, 8:23am UTC](https://root-forum.cern.ch/t/how-to-use-getroccurve-with-an-existing-loader-folder/50109 "2022-06-17T08:23:33Z")

</div>

Hi, experts, In the TMVA tutorial TMVA\_CNN\_Classification.C, there is this line in the end of the program: auto c1 = factory.GetROCCurve(loader); How do I use this function by itself when I already have an existing lo…

---

## [Convert xgboost model to .xml tmva application file](https://root-forum.cern.ch/t/convert-xgboost-model-to-xml-tmva-application-file/50272)

<div class="topic-metadata">

**Author:** [@zhenxuan](https://root-forum.cern.ch/u/zhenxuan)\
**Replies:** 9\
**Last updated:** [June 10, 2022, 10:18am UTC](https://root-forum.cern.ch/t/convert-xgboost-model-to-xml-tmva-application-file/50272 "2022-06-10T10:18:31Z")

</div>

Hello experts, Recently, I train a xgboost model with sklearn API, and I want to convert it to .xml file for the application in TMVA to do the evaluation. I use the conversion scripts here: HHbbgg\_ETH/convert\_pkl2xml.py…

---

## [Stray cout in TMVA::MethodCategory::GetMvaValue?](https://root-forum.cern.ch/t/stray-cout-in-tmva-getmvavalue/50287)

<div class="topic-metadata">

**Author:** [@valerio.formato](https://root-forum.cern.ch/u/valerio.formato)\
**Replies:** 2\
**Last updated:** [June 7, 2022, 10:35am UTC](https://root-forum.cern.ch/t/stray-cout-in-tmva-getmvavalue/50287 "2022-06-07T10:35:29Z")

</div>

Dear ROOTers, after switching my project to use ROOT 6.26/02 and recompiling I now see a huge amount of output on stdout, such as ... Event is for method 0 spectator is 0.465203 0 classID 1 value -0.770011 type 0 Eve…

---

## [\<GetSeparation\> error in TMVA](https://root-forum.cern.ch/t/getseparation-error-in-tmva/16701)

<div class="topic-metadata">

**Author:** [@Shilpi](https://root-forum.cern.ch/u/Shilpi)\
**Replies:** 3\
**Last updated:** [June 2, 2022, 3:38pm UTC](https://root-forum.cern.ch/t/getseparation-error-in-tmva/16701 "2022-06-02T15:38:24Z")

</div>

Dear experts, I am trying to run TMVA code over my rootfiles but it is giving the following error \[1\]. None of my variables are nan. Please find the code attached which I am using. Could you please shed some light on…

---

## [Save TMVA output plots automatically (without using GUI)](https://root-forum.cern.ch/t/save-tmva-output-plots-automatically-without-using-gui/49944)

<div class="topic-metadata">

**Author:** [@smitmatt](https://root-forum.cern.ch/u/smitmatt)\
**Replies:** 6\
**Last updated:** [May 23, 2022, 10:01am UTC](https://root-forum.cern.ch/t/save-tmva-output-plots-automatically-without-using-gui/49944 "2022-05-23T10:01:27Z")

</div>

Hello! I was wondering if there was a way for me to access and save (as a PDF) several of the TMVA GUI plots that are generated at the end of training? I would like to do this without the need to even open the GUI if po…

---

## [TMVA regression target limits](https://root-forum.cern.ch/t/tmva-regression-target-limits/49973)

<div class="topic-metadata">

**Author:** [@lilina](https://root-forum.cern.ch/u/lilina)\
**Replies:** 3\
**Last updated:** [May 20, 2022, 4:42pm UTC](https://root-forum.cern.ch/t/tmva-regression-target-limits/49973 "2022-05-20T16:42:07Z")

</div>

Hi, I am new to TMVA and I am performing a multi-regression with DNN-GPU following the TMVARegression.C and the TMVARegressionApplication.C from the tutorial. I have to constrain one of the targets to be greater than z…

---

## [Writing part of the TMVA screen output in a file](https://root-forum.cern.ch/t/writing-part-of-the-tmva-screen-output-in-a-file/49990)

<div class="topic-metadata">

**Author:** [@Saumyenk](https://root-forum.cern.ch/u/Saumyenk)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 3:38pm UTC](https://root-forum.cern.ch/t/writing-part-of-the-tmva-screen-output-in-a-file/49990 "2022-05-17T15:38:03Z")

</div>

Hi I am doing BDT analysis with multiple backgrounds and multiple points in the signal phase-space (one at a time). Currently, I am optimising the analysis with the following line TMVA::mvaeffs(DataLoaderName,outfileNa…

---

## [The relationship between input data and output data in TMVA](https://root-forum.cern.ch/t/the-relationship-between-input-data-and-output-data-in-tmva/49931)

<div class="topic-metadata">

**Author:** [@chaerme](https://root-forum.cern.ch/u/chaerme)\
**Replies:** 5\
**Last updated:** [May 12, 2022, 10:31am UTC](https://root-forum.cern.ch/t/the-relationship-between-input-data-and-output-data-in-tmva/49931 "2022-05-12T10:31:47Z")

</div>

I find that several options for reading input data in TMVAGUI are (1b)'Deco' -transform and (1c)'PCA' -transform and (3)Linear Correlation, but I don’t quite understand that (3)Linear Correlation here is based on initial…

---

## [Crashing when running with large samples](https://root-forum.cern.ch/t/crashing-when-running-with-large-samples/49828)

<div class="topic-metadata">

**Author:** [@Juan\_Manuel\_Moreno\_P](https://root-forum.cern.ch/u/Juan_Manuel_Moreno_P)\
**Replies:** 7\
**Last updated:** [May 6, 2022, 6:16am UTC](https://root-forum.cern.ch/t/crashing-when-running-with-large-samples/49828 "2022-05-06T06:16:24Z")

</div>

Hello everyone, I am currently working on an analysis and intend to use BDT for this purpose, however when I run the script it gets stuck on the Dataset building, it is quite a simple script with an structure based on t…

---

## [TMVA PyTorch](https://root-forum.cern.ch/t/tmva-pytorch/49644)

<div class="topic-metadata">

**Author:** [@11133](https://root-forum.cern.ch/u/11133)\
**Replies:** 12\
**Last updated:** [April 25, 2022, 8:12pm UTC](https://root-forum.cern.ch/t/tmva-pytorch/49644 "2022-04-25T20:12:11Z")

</div>

Hi all, I’m trying to train the NN using TMVA PyTorch. I’m stuck at one problem: when I run the script it outputs such error on terminal: You are probably missing the definition of TMVA::PyMethodBase::PyInitialize() …

---

## [TMVA PyKeras comparison with standalone Keras API](https://root-forum.cern.ch/t/tmva-pykeras-comparison-with-standalone-keras-api/49479)

<div class="topic-metadata">

**Author:** [@11133](https://root-forum.cern.ch/u/11133)\
**Replies:** 2\
**Last updated:** [April 19, 2022, 1:34pm UTC](https://root-forum.cern.ch/t/tmva-pykeras-comparison-with-standalone-keras-api/49479 "2022-04-19T13:34:48Z")

</div>

Hi all :wave: I used TMVA PyKeras and trained NN with my data. Then I got the scores from my trained model for the signal and background data. If we look at the distribution the signal samples massively tend to aroun…

---

## [TMVAClassification.C linkage error](https://root-forum.cern.ch/t/tmvaclassification-c-linkage-error/49623)

<div class="topic-metadata">

**Author:** [@yebondar](https://root-forum.cern.ch/u/yebondar)\
**Replies:** 3\
**Last updated:** [April 19, 2022, 12:30pm UTC](https://root-forum.cern.ch/t/tmvaclassification-c-linkage-error/49623 "2022-04-19T12:30:48Z")

</div>

I cannot compile the tutorial’s TMVAClassification.C After running $(root-config --cxx --cflags) TMVAClassification.C -o tmva\_class $(root-config --glibs --libs), I receive errors from linker: /usr/bin/ld: /tmp/ccxpOI…

---

## [Modifying the significance formula for optimizing](https://root-forum.cern.ch/t/modifying-the-significance-formula-for-optimizing/49431)

<div class="topic-metadata">

**Author:** [@Saumyenk](https://root-forum.cern.ch/u/Saumyenk)\
**Replies:** 6\
**Last updated:** [April 12, 2022, 5:24pm UTC](https://root-forum.cern.ch/t/modifying-the-significance-formula-for-optimizing/49431 "2022-04-12T17:24:56Z")

</div>

Hi experts, I am running Classification (BDT) with one BSM signal and multiple backgrounds. I wanted to know if it’s possible to use any other significance formula to optimize the method. I saw this post to use Asimov s…

---

## [Does up-to-date TMVA user guide exists?](https://root-forum.cern.ch/t/does-up-to-date-tmva-user-guide-exists/49465)

<div class="topic-metadata">

**Author:** [@FoxWise](https://root-forum.cern.ch/u/FoxWise)\
**Replies:** 2\
**Last updated:** [April 5, 2022, 8:19am UTC](https://root-forum.cern.ch/t/does-up-to-date-tmva-user-guide-exists/49465 "2022-04-05T08:19:31Z")

</div>

Hi all, Does up-to-date TMVA users guide exists? I find it very helpful, as it has verbose step-by-step examples, but the only version I could find: still has AddBackgroundTree() and AddSignalTree() method in the TMV…

---

## [Adding weights to multiple backgrounds and significance value](https://root-forum.cern.ch/t/adding-weights-to-multiple-backgrounds-and-significance-value/49356)

<div class="topic-metadata">

**Author:** [@Antara\_Mehta](https://root-forum.cern.ch/u/Antara_Mehta)\
**Replies:** 3\
**Last updated:** [March 28, 2022, 12:47pm UTC](https://root-forum.cern.ch/t/adding-weights-to-multiple-backgrounds-and-significance-value/49356 "2022-03-28T12:47:34Z")

</div>

Hi, I’m trying to setup a training with signal and multiple backgrounds, but I’m really confused with how to set weight the multiple backgrounds so that they are normalised to the same luminosity and how the PrepareTrai…

---

## [Error while training CNN in TMVA](https://root-forum.cern.ch/t/error-while-training-cnn-in-tmva/38228)

<div class="topic-metadata">

**Author:** [@darthgera123](https://root-forum.cern.ch/u/darthgera123)\
**Replies:** 3\
**Last updated:** [March 28, 2022, 8:27am UTC](https://root-forum.cern.ch/t/error-while-training-cnn-in-tmva/38228 "2022-03-28T08:27:50Z")

</div>

Hi, I am trying to implement a simple CNN in TMVA. I have 2 TTree objects sig\_tree;1 and bkg\_tree;1. When I try to train them after I write factory.TrainAllMethods();, I get this error - Factory : Trai…

---

## ['TTree' object has no attribute 'AsMatrix'](https://root-forum.cern.ch/t/ttree-object-has-no-attribute-asmatrix/49357)

<div class="topic-metadata">

**Author:** [@Sayandeep\_Ghosh](https://root-forum.cern.ch/u/Sayandeep_Ghosh)\
**Replies:** 1\
**Last updated:** [March 25, 2022, 10:51am UTC](https://root-forum.cern.ch/t/ttree-object-has-no-attribute-asmatrix/49357 "2022-03-25T10:51:44Z")

</div>

ROOT Version : 6.27/01 Platform: Ubuntu(WSL) in Windows Hi !, I am currently working with a TMVA file in python and loaded the signal tree like: signalTree = inputFile.Get(‘sig\_tree’) backgroundTree = inputFile.Get(…

---

## [The correlation matrix in TMVA is -nan](https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302)

<div class="topic-metadata">

**Author:** [@chaerme](https://root-forum.cern.ch/u/chaerme)\
**Replies:** 8\
**Last updated:** [March 23, 2022, 11:37pm UTC](https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302 "2022-03-23T23:37:43Z")

</div>

Hi, I wrote a program similar to classification function in imitation of “TMVAClassification.C” and set three variables. However, when I tried to run my program, I found that the correlation matrix for each variable was…

---

## [TMVA classification separation definition](https://root-forum.cern.ch/t/tmva-classification-separation-definition/49326)

<div class="topic-metadata">

**Author:** [@zhwenyu](https://root-forum.cern.ch/u/zhwenyu)\
**Replies:** 1\
**Last updated:** [March 23, 2022, 11:27pm UTC](https://root-forum.cern.ch/t/tmva-classification-separation-definition/49326 "2022-03-23T23:27:49Z")

</div>

I am trying to understand the Separation definition in TMVA. I understood that for each classifier a separation is calculated by equation (1) in https://root.cern.ch/root/htmldoc/guides/tmva/TMVAUsersGuide.pdf Section 3…

---

## [Book multiple keras methods with different models (with different input sizes)](https://root-forum.cern.ch/t/book-multiple-keras-methods-with-different-models-with-different-input-sizes/48888)

<div class="topic-metadata">

**Author:** [@JanEric](https://root-forum.cern.ch/u/JanEric)\
**Replies:** 10\
**Last updated:** [March 18, 2022, 1:46pm UTC](https://root-forum.cern.ch/t/book-multiple-keras-methods-with-different-models-with-different-input-sizes/48888 "2022-03-18T13:46:01Z")

</div>

Currently trying to implement keras DNNs as an alternative MVA (besides BDTs) for our analysis. For the BDTs we optimize both which variables we want to input as well as all of the hyperparameters of the BDTs and this w…

---

## [Error with TMVA sofie](https://root-forum.cern.ch/t/error-with-tmva-sofie/49188)

<div class="topic-metadata">

**Author:** [@Sayandeep\_Ghosh](https://root-forum.cern.ch/u/Sayandeep_Ghosh)\
**Replies:** 15\
**Last updated:** [March 16, 2022, 9:36am UTC](https://root-forum.cern.ch/t/error-with-tmva-sofie/49188 "2022-03-16T09:36:28Z")

</div>

Whenever I try to run sayang@DESKTOP-IFS80HM:~/root\_src/tutorials/tmva$ root TMVA\_SOFIE\_ONNX.C its showing: /home/sayang/root\_src/tutorials/tmva/TMVA\_SOFIE\_ONNX.C:15:12: error: no type named ‘RModelParser\_ONNX’ in nam…

---

## [Weights in TMVA Training](https://root-forum.cern.ch/t/weights-in-tmva-training/49205)

<div class="topic-metadata">

**Author:** [@Antara\_Mehta](https://root-forum.cern.ch/u/Antara_Mehta)\
**Replies:** 2\
**Last updated:** [March 16, 2022, 8:31am UTC](https://root-forum.cern.ch/t/weights-in-tmva-training/49205 "2022-03-16T08:31:17Z")

</div>

Hello, I am using TMVA BDT Classification. I need to train and test the method on discrete samples of signal and backgrounds. I have some questions related to assigning weights to properly mix the different background p…

---

## [Functional API](https://root-forum.cern.ch/t/functional-api/49176)

<div class="topic-metadata">

**Author:** [@11133](https://root-forum.cern.ch/u/11133)\
**Replies:** 3\
**Last updated:** [March 15, 2022, 10:41am UTC](https://root-forum.cern.ch/t/functional-api/49176 "2022-03-15T10:41:22Z")

</div>

Hi all, I just have a quick question: Can we create NN with Keras Functional API in TMVA??? Cheers, :wink:

---

## [ROC AUC discrepancy](https://root-forum.cern.ch/t/roc-auc-discrepancy/49098)

<div class="topic-metadata">

**Author:** [@11133](https://root-forum.cern.ch/u/11133)\
**Replies:** 7\
**Last updated:** [March 10, 2022, 4:45pm UTC](https://root-forum.cern.ch/t/roc-auc-discrepancy/49098 "2022-03-10T16:45:59Z")

</div>

Hi forum! I have a dilemma, so any help would be appreciated! When I train the DNN with TMVA (PyKeras method), I see the ROC-integ value on the terminal once the training ends. And recently, I also learned how to extrac…

---

## [TMVA::Reader::AddVariable: How to cast Double\_t type variable to Float\_t](https://root-forum.cern.ch/t/tmva-how-to-cast-double-t-type-variable-to-float-t/48928)

<div class="topic-metadata">

**Author:** [@shubh](https://root-forum.cern.ch/u/shubh)\
**Replies:** 2\
**Last updated:** [March 5, 2022, 9:04am UTC](https://root-forum.cern.ch/t/tmva-how-to-cast-double-t-type-variable-to-float-t/48928 "2022-03-05T09:04:51Z")

</div>

Dear Experts, While evaluating the MVA response through TMVA::Reader::AddVariable. I faced the problem of the method AddVariable only accepting Float\_t variables (or Int\_t), but not Double\_t. I can import variables of …

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

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