# TMVA

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

[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:** 8

---

## [Problems with running TMVA MLP on different machines](https://root-forum.cern.ch/t/problems-with-running-tmva-mlp-on-different-machines/46947)

<div class="topic-metadata">

**Author:** [@ChrLau](https://root-forum.cern.ch/u/ChrLau)\
**Replies:** 6\
**Last updated:** [September 29, 2021, 1:39am UTC](https://root-forum.cern.ch/t/problems-with-running-tmva-mlp-on-different-machines/46947 "2021-09-29T01:39:37Z")

</div>

Hi ! I am trying to do regression with MLP and found a little inconsistency in the training output between running the code interactively and submitting batch jobs. I initially have eventsampling turned on. The trainin…

---

## [TMVA training with multiple backgrounds and prepared training/test samples](https://root-forum.cern.ch/t/tmva-training-with-multiple-backgrounds-and-prepared-training-test-samples/46746)

<div class="topic-metadata">

**Author:** [@mgoncerz](https://root-forum.cern.ch/u/mgoncerz)\
**Replies:** 5\
**Last updated:** [September 28, 2021, 3:38pm UTC](https://root-forum.cern.ch/t/tmva-training-with-multiple-backgrounds-and-prepared-training-test-samples/46746 "2021-09-28T15:38:48Z")

</div>

Hello! I’m trying to setup a training with signal and multiple weighted backgrounds, but I’m really confused with how the PrepareTrainingAndTestTree method should be called. I already have them split in testing and trai…

---

## [How the TMVA PDF makes the KDE estimation from histograms](https://root-forum.cern.ch/t/how-the-tmva-pdf-makes-the-kde-estimation-from-histograms/46849)

<div class="topic-metadata">

**Author:** [@mverissi](https://root-forum.cern.ch/u/mverissi)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 3:28pm UTC](https://root-forum.cern.ch/t/how-the-tmva-pdf-makes-the-kde-estimation-from-histograms/46849 "2021-09-28T15:28:57Z")

</div>

Dear experts, I know that KDE estimation uses unbinned data, but the TMVA uses a histogram (TH1F). I want to know how TMVA deals with the histogram, I mean they get the histogram and resample unbinned data according to …

---

## [Convert torchscript model to .xml files](https://root-forum.cern.ch/t/convert-torchscript-model-to-xml-files/46649)

<div class="topic-metadata">

**Author:** [@qiutt](https://root-forum.cern.ch/u/qiutt)\
**Replies:** 4\
**Last updated:** [September 6, 2021, 7:30am UTC](https://root-forum.cern.ch/t/convert-torchscript-model-to-xml-files/46649 "2021-09-06T07:30:36Z")

</div>

I have a pytorch model trained in python without ROOT. Now I wish to load the model in C++ using ROOT for event-by-event inference. The C++ ROOT version which I am going to use comes with the ATLAS analysis release and i…

---

## [A problem about how to change the training points style in the overtraing plot?](https://root-forum.cern.ch/t/a-problem-about-how-to-change-the-training-points-style-in-the-overtraing-plot/46634)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 10:39am UTC](https://root-forum.cern.ch/t/a-problem-about-how-to-change-the-training-points-style-in-the-overtraing-plot/46634 "2021-09-02T10:39:32Z")

</div>

Hi all， I have a data style problem in the plot below.Now I would like to change the points style（red and blue points）of the training sample ,but actually I could not even choose these points because there is another la…

---

## [Overtraining/Overfitting in BDTs for HEP and the wider community](https://root-forum.cern.ch/t/overtraining-overfitting-in-bdts-for-hep-and-the-wider-community/41149)

<div class="topic-metadata">

**Author:** [@masticore2020](https://root-forum.cern.ch/u/masticore2020)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 10:01am UTC](https://root-forum.cern.ch/t/overtraining-overfitting-in-bdts-for-hep-and-the-wider-community/41149 "2021-09-02T10:01:54Z")

</div>

Hello! I’ve been looking into TMVA alongside some of the less HEP specific multivariate analysis tools (primarily using BDT’s like AdaBoost and gradient boosting such as XGBoost). In the wider non-HEP sense whenever o…

---

## [TMVA::Reader segfault when on heap](https://root-forum.cern.ch/t/tmva-reader-segfault-when-on-heap/46128)

<div class="topic-metadata">

**Author:** [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Replies:** 7\
**Last updated:** [September 2, 2021, 8:21am UTC](https://root-forum.cern.ch/t/tmva-reader-segfault-when-on-heap/46128 "2021-09-02T08:21:40Z")

</div>

ROOT Version: 5.28 Platform: CentOS7 Compiler: 4.8.5 Hi ROOTers. I’m trying to pull some code that uses a TMVA::Reader into our framework, but for some reason code that’s working externally seems to be segmentation…

---

## [Train TMVA wiht just one input sample](https://root-forum.cern.ch/t/train-tmva-wiht-just-one-input-sample/46251)

<div class="topic-metadata">

**Author:** [@martis](https://root-forum.cern.ch/u/martis)\
**Replies:** 2\
**Last updated:** [August 30, 2021, 9:19am UTC](https://root-forum.cern.ch/t/train-tmva-wiht-just-one-input-sample/46251 "2021-08-30T09:19:58Z")

</div>

Dear TMVA experts, I started using TMVA recently and so far I am a happy costumer. My understanding is that TMVA training works with two input samples: signal and background. Is this correct? However, I would like to k…

---

## [Dynamicaly add variables to TMVA Reader regardless of branch type](https://root-forum.cern.ch/t/dynamicaly-add-variables-to-tmva-reader-regardless-of-branch-type/46250)

<div class="topic-metadata">

**Author:** [@smitmatt](https://root-forum.cern.ch/u/smitmatt)\
**Replies:** 10\
**Last updated:** [August 27, 2021, 5:10pm UTC](https://root-forum.cern.ch/t/dynamicaly-add-variables-to-tmva-reader-regardless-of-branch-type/46250 "2021-08-27T17:10:19Z")

</div>

Hello, I want to have the user input a vector of strings to be used in the TMVA reader object, but i run into problems when i have more then one type of object in the tree. I.E 1 branch which is of type float and anothe…

---

## [pyKeras neural network - AddSignalTree/AddBackgroundTree weights](https://root-forum.cern.ch/t/pykeras-neural-network-addsignaltree-addbackgroundtree-weights/46345)

<div class="topic-metadata">

**Author:** [@Tommaso\_Diotalevi](https://root-forum.cern.ch/u/Tommaso_Diotalevi)\
**Replies:** 6\
**Last updated:** [August 27, 2021, 1:39pm UTC](https://root-forum.cern.ch/t/pykeras-neural-network-addsignaltree-addbackgroundtree-weights/46345 "2021-08-27T13:39:43Z")

</div>

Dear TMVA experts, I am using pyKeras for training a neural network. When loading the signal and background trees, I use the second argument of the AddSignalTree/AddBackgroundTree function to load the specific weights o…

---

## [One question about variable ranking in TMVA package](https://root-forum.cern.ch/t/one-question-about-variable-ranking-in-tmva-package/46437)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 2\
**Last updated:** [August 27, 2021, 10:06am UTC](https://root-forum.cern.ch/t/one-question-about-variable-ranking-in-tmva-package/46437 "2021-08-27T10:06:51Z")

</div>

Hi all I recently notice one tiny difference about input variables ranking between method unspecific and method specific. if I do not assign the classfication method .The sum of all input variables’ weights are not no…

---

## [MVA distribution for separate background instead of total](https://root-forum.cern.ch/t/mva-distribution-for-separate-background-instead-of-total/46401)

<div class="topic-metadata">

**Author:** [@huiling110](https://root-forum.cern.ch/u/huiling110)\
**Replies:** 2\
**Last updated:** [August 26, 2021, 2:54am UTC](https://root-forum.cern.ch/t/mva-distribution-for-separate-background-instead-of-total/46401 "2021-08-26T02:54:02Z")

</div>

Dear expert, When using TMVA training for multiple backgrounds( for example TT and QCD), I find the MVA score distribution for total backgrounds(TT+QCD) in the output root file. But what if I want to have a look at the …

---

## [Cross validation with BDT, MLP and DL](https://root-forum.cern.ch/t/cross-validation-with-bdt-mlp-and-dl/46407)

<div class="topic-metadata">

**Author:** [@Y.S.Zhang](https://root-forum.cern.ch/u/Y.S.Zhang)\
**Replies:** 6\
**Last updated:** [August 25, 2021, 9:58am UTC](https://root-forum.cern.ch/t/cross-validation-with-bdt-mlp-and-dl/46407 "2021-08-25T09:58:21Z")

</div>

Dear experts, I have a few questions regarding the cross validation. The suggestions on cross validation is to use SplitType=Deterministic if I want to work with TMVACrossValidationApplication. See comments in this l…

---

## [Could I set a few groups of parameters combination in one code script?](https://root-forum.cern.ch/t/could-i-set-a-few-groups-of-parameters-combination-in-one-code-script/46327)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 1\
**Last updated:** [August 18, 2021, 11:39am UTC](https://root-forum.cern.ch/t/could-i-set-a-few-groups-of-parameters-combination-in-one-code-script/46327 "2021-08-18T11:39:26Z")

</div>

Hi，all I come across a practical problems，that when I would like to try different paramter values in BDT algorithm（such as setting the maxdepth between 5~20）I have to run the code many times when I change the maxdepth…

---

## [Strange error when I want to import data into TMVA classification module](https://root-forum.cern.ch/t/strange-error-when-i-want-to-import-data-into-tmva-classification-module/46305)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 2\
**Last updated:** [August 16, 2021, 10:28am UTC](https://root-forum.cern.ch/t/strange-error-when-i-want-to-import-data-into-tmva-classification-module/46305 "2021-08-16T10:28:07Z")

</div>

Hi.all When I try to use signal and background data in TMVAClassificatin.C file. I come across a strange error.Shown below the image.I debug and retry the input data a lot .But it still can not work.How can I sovle this…

---

## [Could I directly obtain the traning and testing plots with the CNN](https://root-forum.cern.ch/t/could-i-directly-obtain-the-traning-and-testing-plots-with-the-cnn/46281)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 1\
**Last updated:** [August 16, 2021, 9:40am UTC](https://root-forum.cern.ch/t/could-i-directly-obtain-the-traning-and-testing-plots-with-the-cnn/46281 "2021-08-16T09:40:43Z")

</div>

Hi all Recently I attempt to use the CNN module（TMVA\_CNN\_Classification.C） to try some image classification missions.I wonder that if the TMVA package could directly output some specific training and testing process plo…

---

## [I get error message when I import 41 variables into a ntuple](https://root-forum.cern.ch/t/i-get-error-message-when-i-import-41-variables-into-a-ntuple/46270)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 2\
**Last updated:** [August 11, 2021, 8:35am UTC](https://root-forum.cern.ch/t/i-get-error-message-when-i-import-41-variables-into-a-ntuple/46270 "2021-08-11T08:35:46Z")

</div>

Hi all, I would like to import 41 variables into ntuple.But the ntuple class could only accept 15 variables（as shown in the picture below）. I wonder how could I solve this problem?Thanks so much .

---

## [Wrong object returned in ROOT when using auto keyword](https://root-forum.cern.ch/t/wrong-object-returned-in-root-when-using-auto-keyword/46188)

<div class="topic-metadata">

**Author:** [@bleu65](https://root-forum.cern.ch/u/bleu65)\
**Replies:** 1\
**Last updated:** [August 5, 2021, 8:45pm UTC](https://root-forum.cern.ch/t/wrong-object-returned-in-root-when-using-auto-keyword/46188 "2021-08-05T20:45:15Z")

</div>

If you use the keyword auto in the interpreter, it doesn’t correctly return (or at least print out the pointer) of the correct object. Bit of a gotcha. For example, I have two instances of a class called Model loaded f…

---

## [TMVA::Reader prediction](https://root-forum.cern.ch/t/tmva-reader-prediction/46131)

<div class="topic-metadata">

**Author:** [@PasqualeAndreola](https://root-forum.cern.ch/u/PasqualeAndreola)\
**Replies:** 3\
**Last updated:** [August 4, 2021, 7:29am UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131 "2021-08-04T07:29:22Z")

</div>

Hi to everybody. I would like to use TMVA to “reshape” the background into the signal. At the moment, I am using the classical approach: I am evaluating the TMVA Method result with reader-\>EvaluateMVA("method") and sel…

---

## [Can I output the probability in a classification mission using a binary classification model?](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965)

<div class="topic-metadata">

**Author:** [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 2:33pm UTC](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965 "2021-08-03T14:33:54Z")

</div>

Hi,I would like to ask a question regarding the classification model.When I use a binary classification model in TMVA package to predict a new testing data.I could get the result that whether it is a signal data or backg…

---

## [Question regarding multiclass training](https://root-forum.cern.ch/t/question-regarding-multiclass-training/46043)

<div class="topic-metadata">

**Author:** [@avenkate](https://root-forum.cern.ch/u/avenkate)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 1:06pm UTC](https://root-forum.cern.ch/t/question-regarding-multiclass-training/46043 "2021-08-03T13:06:13Z")

</div>

Dear experts, I am using a multi-class BDT in my analysis, and I wanted to ask a few questions regarding it. I understand that TMVA is training the multi-class BDTs in the one-vs-rest mode. Does TMVA normalize interna…

---

## [TMVA BDT segmentation violation after "Ranking input variables (method unspecific)..."](https://root-forum.cern.ch/t/tmva-bdt-segmentation-violation-after-ranking-input-variables-method-unspecific/45914)

<div class="topic-metadata">

**Author:** [@smitmatt](https://root-forum.cern.ch/u/smitmatt)\
**Replies:** 2\
**Last updated:** [July 21, 2021, 9:24pm UTC](https://root-forum.cern.ch/t/tmva-bdt-segmentation-violation-after-ranking-input-variables-method-unspecific/45914 "2021-07-21T21:24:14Z")

</div>

Hello, I am running into a strange error when trying to run my BDT classifier. I am completely unsure of the cause. The method seems to work perfectly until reaching the point of " : Ranking inpu…

---

## [RReader does not support Spectators?](https://root-forum.cern.ch/t/rreader-does-not-support-spectators/45951)

<div class="topic-metadata">

**Author:** [@rooter\_03](https://root-forum.cern.ch/u/rooter_03)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 3:39pm UTC](https://root-forum.cern.ch/t/rreader-does-not-support-spectators/45951 "2021-07-21T15:39:10Z")

</div>

Hi, I am trying to use: https://root.cern/doc/master/classTMVA\_1\_1Experimental\_1\_1RReader.html to read an XML file produced with TMVA. The training used an spectator and when I call the constructor I see: \<FATAL\> …

---

## [TMVA: the same samples, but very different results from traintest and apply phase using BDT or MLP](https://root-forum.cern.ch/t/tmva-the-same-samples-but-very-different-results-from-traintest-and-apply-phase-using-bdt-or-mlp/45827)

<div class="topic-metadata">

**Author:** [@yi.yu](https://root-forum.cern.ch/u/yi.yu)\
**Replies:** 3\
**Last updated:** [July 15, 2021, 1:54pm UTC](https://root-forum.cern.ch/t/tmva-the-same-samples-but-very-different-results-from-traintest-and-apply-phase-using-bdt-or-mlp/45827 "2021-07-15T13:54:26Z")

</div>

YiMVA.zip (2.9 MB) Dear all, I trained a BDT model, but when i used the weight file to apply for the same samples (used for train & test), the results are very different. Could you help me with the situation? (ple…

---

## [Issue TMVA application BDT response](https://root-forum.cern.ch/t/issue-tmva-application-bdt-response/45769)

<div class="topic-metadata">

**Author:** [@ffedericaa](https://root-forum.cern.ch/u/ffedericaa)\
**Replies:** 1\
**Last updated:** [July 9, 2021, 12:27pm UTC](https://root-forum.cern.ch/t/issue-tmva-application-bdt-response/45769 "2021-07-09T12:27:05Z")

</div>

Hi all, I have an issue with the output plot of the TMVA application. The shape is not similar to the one I have after the classification. Any idea? output classification: output application:

---

## [Accessing training and test trees after call to \`PrepareTrainingAndTestTree\`](https://root-forum.cern.ch/t/accessing-training-and-test-trees-after-call-to-preparetrainingandtesttree/45747)

<div class="topic-metadata">

**Author:** [@xmif0001](https://root-forum.cern.ch/u/xmif0001)\
**Replies:** 4\
**Last updated:** [July 9, 2021, 6:58am UTC](https://root-forum.cern.ch/t/accessing-training-and-test-trees-after-call-to-preparetrainingandtesttree/45747 "2021-07-09T06:58:11Z")

</div>

Hi there! I’m a summer student at CERN currently working on BDT benchmarking for TMVA. However, this is my first week and I’m still very new to TMVA and ROOT, so I’m unfamiliar with certain things. I think to illustrate…

---

## [TMVA kCuts Genetic Algorithm](https://root-forum.cern.ch/t/tmva-kcuts-genetic-algorithm/45694)

<div class="topic-metadata">

**Author:** [@Chipper](https://root-forum.cern.ch/u/Chipper)\
**Replies:** 3\
**Last updated:** [July 9, 2021, 6:32am UTC](https://root-forum.cern.ch/t/tmva-kcuts-genetic-algorithm/45694 "2021-07-09T06:32:33Z")

</div>

Hello, experts, I wanna have some helps: how to change the fitness function for the genetic algorithm inside MVA-kCuts? Thanks a lot!

---

## [Variable ranking - Keras NN training](https://root-forum.cern.ch/t/variable-ranking-keras-nn-training/45703)

<div class="topic-metadata">

**Author:** [@ktali](https://root-forum.cern.ch/u/ktali)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 4:25pm UTC](https://root-forum.cern.ch/t/variable-ranking-keras-nn-training/45703 "2021-07-08T16:25:02Z")

</div>

Dear experts, In the TMVA guide, section 9.1.4, it is indicated that variable ranking is not supported for Keras, yet in the output logs of the NN training using Keras there is a table of variable ranking, and the numbe…

---

## [Generate the dictionary for this collection (vector\<TLorentzVector\>) in TMVA](https://root-forum.cern.ch/t/generate-the-dictionary-for-this-collection-vector-tlorentzvector-in-tmva/45751)

<div class="topic-metadata">

**Author:** [@setesami](https://root-forum.cern.ch/u/setesami)\
**Replies:** 5\
**Last updated:** [July 8, 2021, 3:48pm UTC](https://root-forum.cern.ch/t/generate-the-dictionary-for-this-collection-vector-tlorentzvector-in-tmva/45751 "2021-07-08T15:48:47Z")

</div>

I am using TMVA from ROOT 6.20/04 and try to read a vector of TLorentzVector. I know that I should generate the dictionary but non of the ways I found are working here is the part of the code I use #ifdef \_\_CINT\_\_ #p…

---

## [TMVA extract optimal cut with various numbers of signal and background events like in the classifier cut efficiencies 5a in TMVAGui](https://root-forum.cern.ch/t/tmva-extract-optimal-cut-with-various-numbers-of-signal-and-background-events-like-in-the-classifier-cut-efficiencies-5a-in-tmvagui/45467)

<div class="topic-metadata">

**Author:** [@Yao\_Yao](https://root-forum.cern.ch/u/Yao_Yao)\
**Replies:** 3\
**Last updated:** [June 23, 2021, 5:32pm UTC](https://root-forum.cern.ch/t/tmva-extract-optimal-cut-with-various-numbers-of-signal-and-background-events-like-in-the-classifier-cut-efficiencies-5a-in-tmvagui/45467 "2021-06-23T17:32:45Z")

</div>

Dear experts, I would like to ask how to write a piece of code instead of opening the TMVAGui and modifying the number of signal and background events manually in the Classifier cut efficiency (5a). I’ve been looking in…

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

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