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
Conversation
Thanks for your contribution! |
|
||
|
||
给定输入Tensor,计算输入Tensor的皮尔逊积矩相关系数矩阵。 | ||
细节请参考cov文档. 皮尔逊积矩相关系数 `R`和 协方差矩阵`C`的关系如下: |
There was a problem hiding this comment.
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。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 括号里的标点符号使用中文,
- 参数后面不加:
|
||
返回: | ||
::::::::: | ||
- Tensor, 输入x的皮尔逊积矩相关系数矩阵。 |
There was a problem hiding this comment.
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. ]]) | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 代码示例 后面不加:
- 代码部分使用copy-from的方式,文档参考
|
||
皮尔逊积矩相关系数 `R` 和协方差矩阵 `C` 的关系如下: | ||
|
||
.. math:: R_{ij} = \\frac{ C_{ij} } { \\sqrt{ C_{ii} * C_{jj} } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显示还是不对,把 \\
改成 \
,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显示还是不对,把
\\
改成\
,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考
好的好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显示还是不对,把
\\
改成\
,另外可以自己查看预览链接核对,每次触发CI都会生成新的官网预览,文档参考
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
corrcoef doc
PADDLEPADDLE_PR=40690