Python Seaborn在boxplots中如何确定异常值

2024-05-15 12:36:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我想知道在Seaborn的boxplot分布中,用什么算法来确定“离群值”。

在他们的网站上seaborn.boxplot他们简单地说:

The box shows the quartiles of the dataset while the whiskers extend to show the rest of the distribution, except for points that are determined to be “outliers” using a method that is a function of the inter-quartile range.

我很想知道他们用什么方法。我从一个数据帧创建了boxplots,我似乎有很多“离群值”。

boxplots of my dataframe 谢谢


Tags: oftheto算法boxthat网站seaborn
2条回答

如果您进一步阅读您链接的页面(或ctrl-f表示“异常值”),您将看到:

whis : float, optional
    Proportion of the IQR past the low and high quartiles to extend the plot whiskers.
    Points outside this range will be identified as outliers.

通过测试,seaborn似乎使用whis=1.5作为默认值。

whis定义为

Proportion of the IQR past the low and high quartiles to extend the plot whiskers.

对于正态分布,interquartile range包含50%的人口,1.5*IQR包含大约99%。

相关问题 更多 >