GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » TMVA - weight(s)
TMVA - weight(s) [message #17976] Sat, 07 March 2015 12:09 Go to next message
Elisabetta Prencipe (2) is currently offline  Elisabetta Prencipe (2)
Messages: 214
Registered: February 2013
first-grade participant
From: *hsi06.unitymediagroup.de
Dear multi-variate-analysis experts,

recently I did some studies to train a NN and Fischer discriminant, using a sample of signal and a sample of background, not properly normalized to the same equivalent luminosity.
Basically the standard standalone tool works fine. I downloaded it from here: http://tmva.sourceforge.net

In the test-macro they provide (here it is attached), there is the possibility to assign different weights to signal and background sample. I set up the signal weight to 1, and the bkg weight to 300 (in my particular case). However, it looks that the output plot never changes, depending on different weights applied to the background root-tree (I tried with w=50, 300, 300); this is not what I would expect. I attac here the KNN output plot.

The part of the code where one can set up the weights, for example, is here:


// --- Register the training and test trees

TTree *signal = (TTree*)input->Get("TreeS");
TTree *background = (TTree*)input->Get("TreeB");


// global event weights per tree (see below for setting event-wise weights)
Double_t signalWeight = 1.0;
Double_t backgroundWeight = 50.0;


// You can add an arbitrary number of signal or background trees
factory->AddSignalTree ( signal, signalWeight );
factory->AddBackgroundTree( background, backgroundWeight );

What am I doing wrong here, in your opinion?

Thank you in advance for any feedback,

Elisabetta
Re: TMVA - weight(s) [message #17977 is a reply to message #17976] Sat, 07 March 2015 13:12 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 124.16.103*
I'm not surprised, since the plot you are showing has normalized histograms. Try to check what is happening in the ROC curve.
Re: TMVA - weight(s) [message #17978 is a reply to message #17977] Sat, 07 March 2015 14:27 Go to previous messageGo to next message
Elisabetta Prencipe (2) is currently offline  Elisabetta Prencipe (2)
Messages: 214
Registered: February 2013
first-grade participant
From: *hsi06.unitymediagroup.de
Hi Stefano,

same story: ROC curve does not change if the bkg weight is 1, 50 or 500, for example. This is nasty....
I have an old tool for the Fischer discriminat only. The possibility to add a weight was not, at that time. So, if I trained my F-discriminant with different size of bkg samples, the efficiency curve and the discriminant shape, looked different. I am confused on how TMVA works, honestly.

Here are two possibilities:

a) something is wrong with this tool;
b) the tool is ok, I do not understand how it works.

I am in favor of b)....

Any suggestion?

Elisabetta
Re: TMVA - weight(s) [message #17979 is a reply to message #17978] Sat, 07 March 2015 14:34 Go to previous message
Elisabetta Prencipe (2) is currently offline  Elisabetta Prencipe (2)
Messages: 214
Registered: February 2013
first-grade participant
From: *hsi06.unitymediagroup.de
Ah,
I think I found what shall I look to get differences.
The curve called "classifier cut efficiencies" shows the efficency of sig and bkg, and gives you a rat-window where you can change the scaling factor S/B. And they vary depending on the ratio that you suggest as input.

Good! One problem less!


Elisabetta
Previous Topic: MVA in PandaRoot
Next Topic: Reconstructed photon energy for single photon event
Goto Forum:
  


Current Time: Sat Dec 14 08:15:59 CET 2024

Total time taken to generate the page: 0.00649 seconds