和顺 / 衡律 返回所属 Agent
12.6

预测校准与信号管理

原能力

验证预测校准和信号状态,控制模型漂移、资格变化及重新评价。(合同附件 R7 12.6)

首选项目

scikit-learn(BSD-3-Clause)。 scikit-learn

匹配范围

校准曲线和时间序列交叉验证。

源码

scikit-learn · def calibration_curve(

sklearn/calibration.py · 1329–1342 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def calibration_curve(
    y_true,
    y_prob,
    *,
    pos_label=None,
    n_bins="warn",
    strategy="warn",
):
    """Compute true and predicted probabilities for a calibration curve.

    The method assumes the inputs come from a binary classifier, and
    discretize the [0, 1] interval into bins.

    Calibration curves may also be referred to as reliability diagrams.
  • # SPDX-License-Identifier: BSD-3-Clause

StatsForecast · def cross_validation(

python/statsforecast/core.py · 1896–1909 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def cross_validation(
        self,
        h: int,
        df: Any,
        n_windows: int = 1,
        step_size: int = 1,
        test_size: Optional[int] = None,
        input_size: Optional[int] = None,
        level: Optional[List[int]] = None,
        fitted: bool = False,
        refit: Union[bool, int] = True,
        prediction_intervals: Optional[ConformalIntervals] = None,
        id_col: str = "unique_id",
        time_col: str = "ds",

实现与验收要点

冻结真实标签、signal 失效和时间外校准准入。