From 9d0b81ac95aa3934f97ddca93776abe4ed5c202e Mon Sep 17 00:00:00 2001 From: Lukas Beiske Date: Mon, 6 Nov 2023 14:16:59 +0100 Subject: [PATCH] Count invalid events as non-predictable, not valid events --- ctapipe/tools/train_disp_reconstructor.py | 2 +- ctapipe/tools/train_energy_regressor.py | 2 +- ctapipe/tools/train_particle_classifier.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ctapipe/tools/train_disp_reconstructor.py b/ctapipe/tools/train_disp_reconstructor.py index ec69a3d13b8..6b3ad6d0314 100644 --- a/ctapipe/tools/train_disp_reconstructor.py +++ b/ctapipe/tools/train_disp_reconstructor.py @@ -168,7 +168,7 @@ def _read_table(self, telescope_type): valid = check_valid_rows(table_chunk) if not np.all(valid): - n_non_predictable += np.sum(valid) + n_non_predictable += np.sum(~valid) table_chunk = table_chunk[valid] table.append(table_chunk) diff --git a/ctapipe/tools/train_energy_regressor.py b/ctapipe/tools/train_energy_regressor.py index 3032e9237b3..7fe7986b380 100644 --- a/ctapipe/tools/train_energy_regressor.py +++ b/ctapipe/tools/train_energy_regressor.py @@ -151,7 +151,7 @@ def _read_table(self, telescope_type): valid = check_valid_rows(table_chunk) if not np.all(valid): - n_non_predictable += np.sum(valid) + n_non_predictable += np.sum(~valid) table_chunk = table_chunk[valid] table.append(table_chunk) diff --git a/ctapipe/tools/train_particle_classifier.py b/ctapipe/tools/train_particle_classifier.py index d3d1d8074db..76865cd5366 100644 --- a/ctapipe/tools/train_particle_classifier.py +++ b/ctapipe/tools/train_particle_classifier.py @@ -202,7 +202,7 @@ def _read_table(self, telescope_type, loader, n_events=None): valid = check_valid_rows(table_chunk) if not np.all(valid): - n_non_predictable += np.sum(valid) + n_non_predictable += np.sum(~valid) table_chunk = table_chunk[valid] table.append(table_chunk)