From 12d276a742a87ae441768d5a85450d6f2f53c348 Mon Sep 17 00:00:00 2001 From: Gernot Maier Date: Thu, 27 Aug 2026 19:50:56 +0200 Subject: [PATCH] Remove width_length --- README.md | 4 ++-- src/eventdisplay_ml/config.py | 4 ++-- src/eventdisplay_ml/data_processing.py | 3 --- src/eventdisplay_ml/features.py | 1 - tests/test_data_processing_remaining.py | 1 + tests/test_features.py | 3 --- tests/test_regression_contracts.py | 1 - 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3e8ffd3..dbbf2c1 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ The stereo regression training pipeline uses multi-target XGBoost to predict res By default, regression uses the extended feature set. An optional reduced set can be selected with `--feature_profile reduced`; it contains the array-level geometry -and energy quantities plus `width_length`, `R_core`, and `loss` summaries for -telescope positions 0--3. The default is unchanged with `--feature_profile extended`. +and energy quantities plus `R_core` and `loss` summaries for telescope positions +0--3. The default is unchanged with `--feature_profile extended`. **Key techniques:** diff --git a/src/eventdisplay_ml/config.py b/src/eventdisplay_ml/config.py index 3d4f325..75b5b77 100644 --- a/src/eventdisplay_ml/config.py +++ b/src/eventdisplay_ml/config.py @@ -45,8 +45,8 @@ def configure_training(analysis_type): default="extended", help=( "Regression feature set. 'extended' retains all non-target features; " - "'reduced' uses array-level quantities and width/length, R_core, " - "and loss summaries for telescope positions 0-3." + "'reduced' uses array-level quantities plus R_core and loss summaries " + "for telescope positions 0-3." ), ) if analysis_type == "classification": diff --git a/src/eventdisplay_ml/data_processing.py b/src/eventdisplay_ml/data_processing.py index 0c370ab..f35366b 100644 --- a/src/eventdisplay_ml/data_processing.py +++ b/src/eventdisplay_ml/data_processing.py @@ -1376,9 +1376,6 @@ def flatten_telescope_variables( new_cols[f"loss_dist_{i}"] = df_flat[f"loss_{i}"] * df_flat[f"dist_{i}"] if f"size_{i}" in df_flat and f"dist_{i}" in df_flat and keep_size_vars: new_cols[f"size_dist2_{i}"] = df_flat[f"size_{i}"] / (df_flat[f"dist_{i}"] ** 2 + 1e-6) - if f"width_{i}" in df_flat and f"length_{i}" in df_flat: - new_cols[f"width_length_{i}"] = df_flat[f"width_{i}"] / (df_flat[f"length_{i}"] + 1e-6) - df_flat = pd.concat([df_flat, pd.DataFrame(new_cols, index=index)], axis=1) # inspect ordering and magnitudes before clipping/log10 diff --git a/src/eventdisplay_ml/features.py b/src/eventdisplay_ml/features.py index fe2fdab..69f1e6f 100644 --- a/src/eventdisplay_ml/features.py +++ b/src/eventdisplay_ml/features.py @@ -135,7 +135,6 @@ def regression_feature_columns(columns, profile="extended"): "EmissionHeight", "Geomagnetic_Angle", "array_footprint", - *[f"width_length_{i}" for i in range(4)], *[f"R_core_{i}" for i in range(4)], *[f"loss_{i}" for i in range(4)], ] diff --git a/tests/test_data_processing_remaining.py b/tests/test_data_processing_remaining.py index ed21d97..885be9d 100644 --- a/tests/test_data_processing_remaining.py +++ b/tests/test_data_processing_remaining.py @@ -152,6 +152,7 @@ def test_flatten_feature_data_drops_size_columns_for_classification(tel_config): assert "size_0" not in result.columns assert "size_dist2_0" not in result.columns + assert "width_length_0" not in result.columns assert "cosphi_0" in result.columns assert "ze_bin" in result.columns diff --git a/tests/test_features.py b/tests/test_features.py index 743b4ce..7683997 100644 --- a/tests/test_features.py +++ b/tests/test_features.py @@ -88,7 +88,6 @@ def test_reduced_regression_feature_columns_are_stable_and_exact(): "EmissionHeight", "Geomagnetic_Angle", "array_footprint", - *[f"width_length_{i}" for i in range(4)], *[f"R_core_{i}" for i in range(4)], *[f"loss_{i}" for i in range(4)], "E_residual", @@ -107,7 +106,6 @@ def test_reduced_regression_feature_columns_are_stable_and_exact(): "EmissionHeight", "Geomagnetic_Angle", "array_footprint", - *[f"width_length_{i}" for i in range(4)], *[f"R_core_{i}" for i in range(4)], *[f"loss_{i}" for i in range(4)], ] @@ -129,7 +127,6 @@ def test_reduced_regression_feature_columns_require_all_requested_columns(): "EmissionHeight", "Geomagnetic_Angle", "array_footprint", - *[f"width_length_{i}" for i in range(4)], *[f"R_core_{i}" for i in range(4)], *[f"loss_{i}" for i in range(3)], ], diff --git a/tests/test_regression_contracts.py b/tests/test_regression_contracts.py index 65194da..8acceba 100644 --- a/tests/test_regression_contracts.py +++ b/tests/test_regression_contracts.py @@ -130,7 +130,6 @@ def test_regression_training_reduced_profile_selects_requested_columns(monkeypat "EmissionHeight", "Geomagnetic_Angle", "array_footprint", - *[f"width_length_{i}" for i in range(4)], *[f"R_core_{i}" for i in range(4)], *[f"loss_{i}" for i in range(4)], ]