cta-observatory / cta-lstchain

LST prototype testbench chain
https://cta-observatory.github.io/cta-lstchain/
BSD 3-Clause "New" or "Revised" License
22 stars 77 forks source link

Training failure when using features computed after utils.filter_events #1206

Closed gabemery closed 3 months ago

gabemery commented 5 months ago

In lstchain.reco.dl1_to_dl2 build_models() there is a set of quantities which are computed after the call to utils.filter_events. Namely : signed_time_gradient, signed_skewness, sometimes sin_az_tel, and the reconstructed energy and disp.

It means that the training can fail (in particular for the classifier) if any of these quantities are Nan since the filtering code is called before their creation.

How did I encounter the error : The time_gradient often has more Nan than Hillas parameters (when the image is 2 pixels). Trying to train a models without the time_gradient but with the signed_time_gradient in the classifier, these values are not removed.

Possible fix : re-run the filterbetween the creation of new features and trainings.