gpt4 book ai didi

python - mustache 被定义为 1.5* IQR,python seaborn boxplot 中的两个 mustache 怎么会不同呢?

转载 作者:行者123 更新时间:2023-12-01 02:05:18 26 4
gpt4 key购买 nike

根据seaborn documentation ,其箱线图方法使晶须的长度为 1.5*IQR。然而,从该文档的情节中可以看出,情况似乎并非如此。上下须不一样。此外,它似乎不是 1.5 IQR。

有人可以解释一下他们为什么不同吗?

enter image description here https://seaborn.pydata.org/generated/seaborn.boxplot.html

最佳答案

原则上,如果箱线图上的须线使用四分位距 (IQR) 的倍数,则它们应该具有相等的长度,这一假设是正确的。

但是,本质上有两种情况并非如此。不幸的是,英文维基百科版本没有说明这些原因,但让我翻译一下german wikipedia中的解释。 :

Whisker
One possible definition, originating from John W. Tukey, is to restrict the length of the whisker to maximally 1.5 times the inter quartile range (1.5*IQR).

In this case the whisker does however not end exactly at this value, but rather at the value from the data which still lies inside of this boundary. The length of the whisker is hence determined by the data and not solemnly by the inter quartile range. This is the reason why the whisker does not need to be of the same size on both ends of the box. If there are no values outside of the 1.5*IQR boundary, the length of the whisker is determined by the minimal and maximal value. Otherwise, the values outside of the whiskers are marked separately in the diagram; those values can then be treated as outliers.

来自同一维基百科页面的绘图可能会使这一点更加明显:

enter image description here

对于问题中显示的图表,第二个原因肯定适用:即下须线在最低数据值的位置结束。

关于python - mustache 被定义为 1.5* IQR,python seaborn boxplot 中的两个 mustache 怎么会不同呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49139299/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com