Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【PaddlePaddle Hackathon 2】3、为 Paddle 新增 corrcoef(皮尔逊积矩相关系数) #4316

Merged
merged 12 commits into from May 9, 2022

Conversation

liqitong-a
Copy link
Contributor

@liqitong-a liqitong-a commented Mar 18, 2022

corrcoef doc

PADDLEPADDLE_PR=40690

@paddle-bot-old
Copy link

Thanks for your contribution!



给定输入Tensor,计算输入Tensor的皮尔逊积矩相关系数矩阵。
细节请参考cov文档. 皮尔逊积矩相关系数 `R`和 协方差矩阵`C`的关系如下:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 文档需要给出链接
  • 注意中英文标点符号不要混用

- **x** (Tensor) - 一个N(N<=2)维矩阵,包含多个变量。默认矩阵的每行是一个观测变量,由参数rowvar设置。
- **rowvar** (bool, 可选) - 若是True,则每行作为一个观测变量;若是False,则每列作为一个观测变量。默认True。
- **ddof** (bool, 可选) - 在计算中不起作用,不需要。默认False。
- **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为None。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 括号里的标点符号使用中文,
  • 参数后面不加:


返回:
:::::::::
- Tensor, 输入x的皮尔逊积矩相关系数矩阵。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 注意标点符号
  • 返回 后面不加:

[[ 1. , -0.73702252, 0.66228950],
[-0.73702258, 1. , -0.77104872],
[ 0.66228974, -0.77104825, 1. ]])
'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 代码示例 后面不加:
  • 代码部分使用copy-from的方式,文档参考

@Ligoml Ligoml changed the title 【Hackathon No.3】 【PaddlePaddle Hackathon 2】3、为 Paddle 新增 corrcoef(皮尔逊积矩相关系数) Apr 7, 2022

皮尔逊积矩相关系数 `R` 和协方差矩阵 `C` 的关系如下:

.. math:: R_{ij} = \\frac{ C_{ij} } { \\sqrt{ C_{ii} * C_{jj} } }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

显示还是不对,把 \\ 改成 \ ,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

显示还是不对,把 \\ 改成 \ ,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考

好的好的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

显示还是不对,把 \\ 改成 \ ,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考

Done!

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ligoml Ligoml merged commit c6e28ba into PaddlePaddle:develop May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants