EvaluateMulticlass method not consistent with training output (repeating floating point values)

I just tried but a json file with a variable list is missing. Can you add this file?

Sorry, must have run the code directing to my local file. Should be there now.

A file is missing:

Error in <TFile::TFile>: file samples/DiLepTR_ttV_bInclude.root does not exist

I tried to replace it with samples/DiLepSR_ttV_bInclude.root, but this file is corrputed.

Can you let me know if they are ok now? I’ve copied them over again as I suspect something went wrong during the copy.

Besides the fact that your example script was not really runnable, here the main issue i’ve found:

You are booking the variables with this code:

    branches = {}
    for key, value in new_variable_list:
        branches[key] = array('f', [-999])
        reader.AddVariable(str(key), branches[key])

The problem is that your branches are of the D (so double) but you are using a f (float) array. hence, the interpretation of the entry in, e.g., branches["maxeta"][0] are wrong. Compare to tree.maxeta in your eventloop!

You’ll encounter following problem. The TMVA reader does allow only integer or float values. Therefore, you have to convert the inputs somehow to float. Most easily you can do this by booking the reader with arrays of floats but the tree.SetBranchAddress(...) with arrays of doubles. Then, you can simply copy with array_float[0]=array_double[0]. Not the nicest solution, but I get reasonable shapes without spikes.

Ok strange, script seemed to work my end so sorry about that. Anyway, the suggested fix works so that’s excellent.

Thanks a lot Stefan

1 Like