-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docathon][Add CN Doc No.23] (#6372)
* add_doc & fix_overview * fix doc * fix return type * Update docs/api/paddle/static/ctr_metric_bundle_cn.rst Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com> * rerun pre-commit --------- Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
- Loading branch information
1 parent
d298519
commit 01bdb6e
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. _cn_api_paddle_static_ctr_metric_bundle: | ||
|
||
ctr_metric_bundle | ||
------------------------------- | ||
|
||
.. py:function:: paddle.static.ctr_metric_bundle(input, label, ins_tag_weight=None) | ||
CTR 相关度量层 | ||
|
||
此函数用于计算 CTR 相关指标:RMSE(均方根误差)、MAE(平均绝对误差)、predicted_ctr(预测点击率)、q 值。 | ||
|
||
为了计算这些指标的最终值,我们应该使用总实例数进行以下计算: | ||
|
||
- MAE = local_abserr / 实例数 | ||
- RMSE = sqrt(local_sqrerr / 实例数) | ||
- predicted_ctr = local_prob / 实例数 | ||
- q = local_q / 实例数 | ||
|
||
注意,如果您正在进行分布式作业,您应该首先对这些指标和实例数进行全局归约。 | ||
|
||
参数 | ||
:::::::::::: | ||
- **input** (Tensor) - 一个浮点数 2D 张量,值在[0, 1]范围内。每行按降序排列。这个输入应该是 topk 的输出。通常,这个张量表示每个标签的概率。 | ||
- **label** (Tensor) - 表示训练数据标签的 2D 整数张量。高度为批量大小,宽度始终为 1。 | ||
- **ins_tag_weight** (Tensor) - 表示训练数据的 ins_tag_weight 的 2D 整数张量。1 表示真实数据,0 表示假数据。类型为 float32 或 float64 的 LoDTensor 或 Tensor。 | ||
|
||
返回 | ||
:::::::::::: | ||
- **local_sqrerr** (Tensor) - 局部平方误差和 | ||
- **local_abserr** (Tensor) - 局部绝对误差和 | ||
- **local_prob** (Tensor) - 局部预测 CTR 和 | ||
- **local_q** (Tensor) - 局部 q 值和 | ||
- **local_pos_num** (Tensor) - 局部正例数 | ||
- **local_ins_num** (Tensor) - 局部样本数 | ||
|
||
tuple (local_sqrerr, local_abserr, local_prob, local_q, local_pos_num, local_ins_num): 包含局部平方误差和、局部绝对误差和、局部预测 CTR 和、局部 q 值和、局部正例数和局部样本数的元组。 | ||
|
||
|
||
代码示例: | ||
:::::::::: | ||
|
||
COPY-FROM: paddle.static.ctr_metric_bundle |