cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 266 forks source link

Use signal_fraction for training particle classifier #2465

Closed LukasBeiske closed 5 months ago

LukasBeiske commented 8 months ago

This removes the n_signal and n_background options of ctapipe-train-particle-classifier. Instead the total number of training events n_events and the signal_fraction can be chosen, where $$\texttt{signal\_fraction}= \frac{n_s}{n_s + n_b}.$$ If n_events is not specified, as many events as possible will be used considering the given signal_fraction.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9b2088d) 92.53% compared to head (3e2e736) 92.53%.

Files Patch % Lines
src/ctapipe/tools/train_particle_classifier.py 92.85% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2465 +/- ## ======================================= Coverage 92.53% 92.53% ======================================= Files 235 235 Lines 20024 20062 +38 ======================================= + Hits 18529 18565 +36 - Misses 1495 1497 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

LukasBeiske commented 8 months ago

I'm not sure why this provenance test is failing right now. It works on my machine...

Edit: Fixed by #2469