Python - 正态性分数

问题描述

有几个事件的 DF:

id 价值
0.5
0.33
0.5
X 0.33

查看一个 DF 的数据,我可以看到事件 Y,X 的以下分布

enter image description here

enter image description here

很明显,一种分布比另一种正态。试图获得分布正常程度的分数,我发现 scipy.stats.normaltest 但我不确定它是否是正确的工具。

这是我试过的:

from scipy import stats

k2,p = stats.normaltest(data.event_X)
alpha = 1e-3
print("p = {:g}".format(p))
p = 8.4713e-19
if p < alpha:  # null hypothesis: x comes from a normal distribution
    print("The null hypothesis can be rejected")
else:
    print("The null hypothesis cannot be rejected")

问:我怎样才能自动化这个过程,所以对于给定的分布,我会得到 0-1 分,分布是正态的可能性有多大?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)