Skip to content
Open
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions skpro/metrics/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ def _evaluate_by_index(self, y_true, y_pred, **kwargs):
if alpha is None:
alphas = y_pred_alphas
else:
# if alpha was provided, check whether they are predicted
# if not all alpha are observed, raise a ValueError
if not np.isin(alpha, y_pred_alphas).all():
# todo: make error msg more informative
# which alphas are missing
msg = "not all quantile values in alpha are available in y_pred"
missing_alphas = np.setdiff1d(alpha, y_pred_alphas)
if len(missing_alphas) > 0:
msg = (
f"Not all quantile values in alpha are available in y_pred. "
f"Missing alphas: {missing_alphas.tolist()}"
Comment thread
Ahmed-Zahran02 marked this conversation as resolved.
Outdated
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change updates user-visible error text for missing quantiles, but existing tests only assert that a ValueError is raised (they don't check the message). Please extend the existing quantile metric negative test to assert the error message includes the missing alpha values (and, if added, the requested/available lists) so future refactors don't regress the improved diagnostics.

Suggested change
f"Missing alphas: {missing_alphas.tolist()}"
f"Missing alphas: {missing_alphas.tolist()}. "
f"Requested alphas: {list(alpha)}. "
f"Available alphas in y_pred: {list(y_pred_alphas)}"

Copilot uses AI. Check for mistakes.
)
raise ValueError(msg)
else:
alphas = alpha
Expand Down
Loading