改进复验
原能力
在相近受众和时间窗口下验证改动,记录哪些变化可复现及哪些仍受干扰。(细化版 p.6–7)
首选项目
scikit-learn(BSD-3-Clause)。 scikit-learn
匹配范围
报表输出与指标函数比较改动前后结果。
源码
scikit-learn · def confusion_matrix(
sklearn/metrics/_classification.py · 443–456 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def confusion_matrix(
y_true, y_pred, *, labels=None, sample_weight=None, normalize=None
):
"""Compute confusion matrix to evaluate the accuracy of a classification.
By definition a confusion matrix :math:`C` is such that :math:`C_{i, j}`
is equal to the number of observations known to be in group :math:`i` and
predicted to be in group :math:`j`.
Thus in binary classification, the count of true negatives is
:math:`C_{0,0}`, false negatives is :math:`C_{1,0}`, true positives is
:math:`C_{1,1}` and false positives is :math:`C_{0,1}`.
Read more in the :ref:`User Guide <confusion_matrix>`.
- # SPDX-License-Identifier: BSD-3-Clause
Matomo · public function getCategory(
plugins/Events/API.php · 229–242 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
public function getCategory($idSite, string $period, string $date, $segment = false, bool $expanded = false, $secondaryDimension = false, bool $flat = false)
{
return $this->getDataTable(__FUNCTION__, $idSite, $period, $date, $segment, $expanded, false, $secondaryDimension, $flat);
}
/**
* Returns event metrics grouped by event action.
*
* @param int|string|int[] $idSite Website ID(s) to query.
* - Single site ID (e.g. 1)
* - Multiple site IDs (e.g. [1, 4, 5])
* - Comma-separated list ("1,4,5") or "all"
* @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the period
* containing the specified date.
实现与验收要点
锁定受众、季节、实验分组、检验标准与干扰处理。