Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/211/two metric fixes #212

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/qp/metrics/concrete_metric_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class CDELossMetric(DistToPointMetric):
"""Conditional density loss"""

metric_name = "cdeloss"
metric_output_type = MetricOutputType.one_value_per_distribution
metric_output_type = MetricOutputType.single_value
default_eval_grid = np.linspace(0, 2.5, 301)

def __init__(self, eval_grid: list = default_eval_grid, **kwargs) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/qp/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def calculate_outlier_rate(p, lower_limit=0.0001, upper_limit=0.9999):
except ValueError: #pragma: no cover - unittest coverage for _check_ensemble_is_not_nested is complete
logging.warning("Each element in the ensemble `p` must be a single distribution.")

outlier_rates = [(dist.cdf(lower_limit) + (1. - dist.cdf(upper_limit)))[0][0] for dist in p]
outlier_rates = np.array([(dist.cdf(lower_limit) + (1. - dist.cdf(upper_limit)))[0][0] for dist in p])
return outlier_rates

def calculate_goodness_of_fit(estimate, reference, fit_metric='ks', num_samples=100, _random_state=None):
Expand Down
Loading