Negative weight when using BDTG

Hi and welcome to the ROOT (online) community!

The reason for the error is most probably that you are using negative weights.

You can either:

  1. specify the bin width of the generated histograms by inserting (adapted from Kolmogorov-Smirnov test values) TMVA::gConfig().GetVariablePlotting()).fNbinsMVAoutput = 25; at the top of your training script (default is fNbinsMVAoutput = 40),

  2. or use a larger training sample!

Details

Negative event weights are sometimes included as correction terms in simulations, however, the events themselves are unphysical. A histogram modelling a probability distribution cannot contain bins with a negative sum, the events with negative weight only make sense in on average. This is what TMVA is complaining about! (The implication is that with the current training data the region in the histogram having a negative sum is poorly modelled.)