和顺 / 衡律 返回所属 Agent
19.1

结果评价与过程评价

原能力

分别评价结果和过程,对照当时预测、决定、执行及实际结果。(合同附件 R7 19.1)

首选项目

Empyrical(Apache-2.0)。 Empyrical

匹配范围

收益统计、过程运行和指标归档。

源码

Empyrical · def cum_returns(

empyrical/stats.py · 219–232 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def cum_returns(returns, starting_value=0, out=None):
    """
    Compute cumulative returns from simple returns.

    Parameters
    ----------
    returns : pd.Series, np.ndarray, or pd.DataFrame
        Returns of the strategy as a percentage, noncumulative.
         - Time series with decimal returns.
         - Example::

            2015-07-16   -0.012143
            2015-07-17    0.045350
            2015-07-20    0.030957
  • # Copyright 2016 Quantopian, Inc.

MLflow · def log_metric(

mlflow/tracking/client.py · 2350–2363 行。 在 GitHub 查看源码 · 许可证与声明

上游配置与指引
    def log_metric(
        self,
        run_id: str,
        key: str,
        value: float,
        timestamp: int | None = None,
        step: int | None = None,
        synchronous: bool | None = None,
        dataset_name: str | None = None,
        dataset_digest: str | None = None,
        model_id: str | None = None,
    ) -> RunOperations | None:
        """
        Log a metric against the run ID.

实现与验收要点

原投资结果与过程标准、时点和证据等级。