和顺 / 知几 返回所属 Agent
ZJ-10.03

校准更新

原能力

在可比历史样本里检查置信区间或判断等级,记录样本不足和拟调整口径。(细化版 p.4–5)

首选项目

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

匹配范围

reliability diagram、Brier 与校准组件。

源码

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

scikit-learn · def brier_score_loss(

sklearn/metrics/_classification.py · 3710–3723 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def brier_score_loss(
    y_true,
    y_proba,
    *,
    sample_weight=None,
    pos_label=None,
    labels=None,
    scale_by_half="auto",
):
    r"""Compute the Brier score loss.

    The smaller the Brier score loss, the better, hence the naming with "loss".
    The Brier score measures the mean squared difference between the predicted
    probability and the actual outcome. The Brier score is a strictly proper scoring
  • # SPDX-License-Identifier: BSD-3-Clause
接口用法示意
calibration_curve(y_true, probabilities, n_bins=10)

实现与验收要点

冻结留出、样本不足判断、随时间漂移后是否发布。