From 0074a28efc4084668bdcca2113bc7d46531fcef2 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Wed, 25 Oct 2023 18:23:27 -0700 Subject: [PATCH 1/2] actually utils is unused, so remove it --- src/rail/evaluation/evaluator.py | 1 - src/rail/evaluation/utils.py | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 src/rail/evaluation/utils.py diff --git a/src/rail/evaluation/evaluator.py b/src/rail/evaluation/evaluator.py index b9fcd9d4..50679077 100644 --- a/src/rail/evaluation/evaluator.py +++ b/src/rail/evaluation/evaluator.py @@ -11,7 +11,6 @@ from rail.core.stage import RailStage from rail.core.common_params import SHARED_PARAMS -from rail.evaluation.utils import stat_and_pval from rail.evaluation.metrics.cdeloss import CDELoss from qp.metrics.pit import PIT from rail.evaluation.metrics.pointestimates import PointSigmaIQR, PointBias, PointOutlierRate, PointSigmaMAD diff --git a/src/rail/evaluation/utils.py b/src/rail/evaluation/utils.py deleted file mode 100644 index a2a98e85..00000000 --- a/src/rail/evaluation/utils.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Tuples that capture standard statisical quantities """ - -from collections import namedtuple - -# These generic mathematical metrics will be moved to qp at some point. -stat_and_pval = namedtuple('stat_and_pval', ['statistic', 'p_value']) -stat_crit_sig = namedtuple('stat_crit_sig', ['statistic', 'critical_values', 'significance_level']) From 60456a3223eadf222d7234ab0822ae08b2dedb1b Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 26 Oct 2023 12:31:22 -0700 Subject: [PATCH 2/2] actually, stat_and_pval is included in metrics/cdeloss.py, put it back, and move it to stats_groups from utils --- src/rail/evaluation/metrics/cdeloss.py | 2 +- src/rail/evaluation/stats_groups.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/rail/evaluation/stats_groups.py diff --git a/src/rail/evaluation/metrics/cdeloss.py b/src/rail/evaluation/metrics/cdeloss.py index ab7fe4c8..6dd372ab 100644 --- a/src/rail/evaluation/metrics/cdeloss.py +++ b/src/rail/evaluation/metrics/cdeloss.py @@ -1,6 +1,6 @@ import numpy as np from .base import MetricEvaluator -from rail.evaluation.utils import stat_and_pval +from rail.evaluation.stats_groups import stat_and_pval class CDELoss(MetricEvaluator): diff --git a/src/rail/evaluation/stats_groups.py b/src/rail/evaluation/stats_groups.py new file mode 100644 index 00000000..a2a98e85 --- /dev/null +++ b/src/rail/evaluation/stats_groups.py @@ -0,0 +1,7 @@ +"""Tuples that capture standard statisical quantities """ + +from collections import namedtuple + +# These generic mathematical metrics will be moved to qp at some point. +stat_and_pval = namedtuple('stat_and_pval', ['statistic', 'p_value']) +stat_crit_sig = namedtuple('stat_crit_sig', ['statistic', 'critical_values', 'significance_level'])