百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#11324·sktime

[BUG] `EmpiricalCoverage` 和 `ConstraintViolation` 将 `y_true` 与多变量数据中其他变量的区间进行比较,且有 2 个以上的覆盖率;非字母顺序的变量名称导致 `PinballLoss` 失调

作者: shaurya416创建于 2026年9月28日更新于 2026年9月29日

sktime/performance_metrics/forecasting/probabilistic/_classes.py:691 (EmpiricalCoverage), same line at :913 (ConstraintViolation):

python
        scores = np.unique(np.round(y_pred.columns.get_level_values(1), 7))
        no_scores = len(scores)
        vars = np.unique(y_pred.columns.get_level_values(0))

        y_true_np = np.tile(y_true_np, no_scores)

        truth_array = (y_true_np >= lower).astype(int) * (y_true_np <= upper).astype(
            int
        )

_check_ys sorts the prediction columns at :337 (y_pred_inner.sort_index(axis=1, level=[0, 1], inplace=True)), so lower and upper are ordered (v0,c0), (v0,c1), (v1,c0), (v1,c1). The output columns are built the same way (pd.MultiIndex.from_product([vars, scores])). np.tile builds the truth as v0, v1, v0, v1. With at least 2 variables and 2 coverages, the off-diagonal cells compare one variable's truth against the other variable's interval. PinballLoss handles the same layout with np.repeat(y_true, axis=1, repeats=len(alphas)) at :579, which pairs the columns correctly.

内容来源: sktime/sktime

查看 GitHub 原文在 GitHub 查看讨论