# TMVA Classification

**URL:** <https://root-forum.cern.ch/t/tmva-classification/41527>\
**Category:** TMVA\
**Created:** [September 21, 2020, 11:48am UTC](https://root-forum.cern.ch/t/tmva-classification/41527 "2020-09-21T11:48:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fogssy](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/e9c0ed/32.png) [@Fogssy](https://root-forum.cern.ch/u/Fogssy)\
**Post date:** [September 21, 2020, 11:48am UTC](https://root-forum.cern.ch/t/tmva-classification/41527/1 "2020-09-21T11:48:50Z")

</div>

Hi everyone,

I wanted to something about the TMVA classification. According to this wiki:  
[http://www.ep.ph.bham.ac.uk/twiki/bin/view/General/TMVA](http://www.ep.ph.bham.ac.uk/twiki/bin/view/General/TMVA)

I need to get a weights file as an output, after the TMVA training (e.g TMVAClassification.weights.xml). However, I don’t get any xml file or something like that, and this file is not defined anywhere in the classification example code. I only get the root output (which they called in this wiki outfileName). Does anyone know, by any chance, how to get the weights file?

Thanks!

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [September 21, 2020, 1:42pm UTC](https://root-forum.cern.ch/t/tmva-classification/41527/2 "2020-09-21T13:42:30Z")

</div>

@moneta Perhaps you can advise?

---

<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:** [September 22, 2020, 7:06am UTC](https://root-forum.cern.ch/t/tmva-classification/41527/3 "2020-09-22T07:06:14Z")

</div>

Hi,  
Which method are you using for classification ? It is possible that for some methods the weight file is not written. If you are using code similar to this macro,  
[https://root.cern.ch/doc/master/TMVAClassification\_8C.html](https://root.cern.ch/doc/master/TMVAClassification_8C.html)

the weight file should be written in the `dataset/weights` directory

Cheers

Lorenzo

---

<div class="post-metadata">

**Author:** ![Fogssy](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/e9c0ed/32.png) [@Fogssy](https://root-forum.cern.ch/u/Fogssy)\
**Post date:** [September 22, 2020, 7:59am UTC](https://root-forum.cern.ch/t/tmva-classification/41527/4 "2020-09-22T07:59:28Z")

</div>

Thank you for your answer, Lorenzo.  
My code is indeed based on the TMVAClassification.C code. The problem is that even when I run this exmaple code, I don’t get this weight directory. This is the content of my dataset directory in the output root file:

TDirectoryFile\* dataset dataset  
KEY: TH2F CorrelationMatrixS;1 Correlation Matrix (signal)  
KEY: TH2F CorrelationMatrixB;1 Correlation Matrix (background)  
KEY: TDirectoryFile InputVariables\_Id;1 InputVariables\_Id  
KEY: TDirectoryFile InputVariables\_Deco;1 InputVariables\_Deco  
KEY: TDirectoryFile InputVariables\_PCA;1 InputVariables\_PCA  
KEY: TDirectoryFile InputVariables\_Gauss\_Deco;1 InputVariables\_Gauss\_Deco  
KEY: TDirectoryFile Method\_Cuts;1 Directory for all Cuts methods  
KEY: TDirectoryFile Method\_CutsD;1 Directory for all Cuts methods  
KEY: TDirectoryFile Method\_Likelihood;1 Directory for all Likelihood methods  
KEY: TDirectoryFile Method\_LikelihoodPCA;1 Directory for all Likelihood methods  
KEY: TDirectoryFile Method\_PDERS;1 Directory for all PDERS methods  
KEY: TDirectoryFile Method\_PDEFoam;1 Directory for all PDEFoam methods  
KEY: TDirectoryFile Method\_KNN;1 Directory for all KNN methods  
KEY: TDirectoryFile Method\_LD;1 Directory for all LD methods  
KEY: TDirectoryFile Method\_FDA\_GA;1 Directory for all FDA methods  
KEY: TDirectoryFile Method\_MLPBNN;1 Directory for all MLP methods  
KEY: TDirectoryFile Method\_SVM;1 Directory for all SVM methods  
KEY: TDirectoryFile Method\_BDT;1 Directory for all BDT methods  
KEY: TDirectoryFile Method\_RuleFit;1 Directory for all RuleFit methods  
KEY: TTree TestTree;1 TestTree  
KEY: TTree TrainTree;1 TrainTree

---

<div class="post-metadata">

**Author:** ![Fogssy](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/e9c0ed/32.png) [@Fogssy](https://root-forum.cern.ch/u/Fogssy)\
**Post date:** [September 22, 2020, 10:58am UTC](https://root-forum.cern.ch/t/tmva-classification/41527/5 "2020-09-22T10:58:04Z")

</div>

Never mind, my bad, it was solved. I got confused between dataset directory in the root file, and the dataset directory of the external directory. Thanks a lot!
