Matplotlib 箱线图:使用什么算法来计算范围和识别异常值?
Matplotlib boxplot: what algorithm is used to calculate range and identify outliers?
我目前正在写我的硕士论文。我已经在自定义编码 Python 中处理了所有数据,我显示数据的主要方法之一是 matplotlib 中的箱线图。我一直在查看文档,但我看不到任何关于它如何对异常值(或 "fliers")进行分类并将它们排除在范围之外的信息。
如果我找不到这些信息并不是世界末日,但如果我没有在方法论章节中完整描述我的统计工具,我会觉得不完整。
来自matplotlib.pyplot api documentation of boxplot。 boxplot 有一个 whis
参数指定胡须的范围。默认值为 1.5.
whis : float, sequence, or string (default = 1.5)
As a float, determines the reach of the whiskers to the beyond the
first and third quartiles. In other words, where IQR is the
interquartile range (Q3-Q1), the upper whisker will extend to last
datum less than Q3 + whisIQR). Similarly, the lower whisker will
extend to the first datum greater than Q1 - whisIQR. Beyond the
whiskers, data are considered outliers and are plotted as individual
points. Set this to an unreasonably high value to force the whiskers
to show the min and max values. Alternatively, set this to an
ascending sequence of percentile (e.g., [5, 95]) to set the whiskers
at specific percentiles of the data. Finally, whis can be the string
'range' to force the whiskers to the min and max of the data.
默认的胡须范围是 1.5* 四分位距。实际上,这意味着在使用默认值时,任何低于 Q1 - 1.5* 四分位距的值和高于 Q3 + 1.5* 四分位距的任何值都将被视为异常值。
给定一个非默认值,输出将针对该值进行调整。
我目前正在写我的硕士论文。我已经在自定义编码 Python 中处理了所有数据,我显示数据的主要方法之一是 matplotlib 中的箱线图。我一直在查看文档,但我看不到任何关于它如何对异常值(或 "fliers")进行分类并将它们排除在范围之外的信息。
如果我找不到这些信息并不是世界末日,但如果我没有在方法论章节中完整描述我的统计工具,我会觉得不完整。
来自matplotlib.pyplot api documentation of boxplot。 boxplot 有一个 whis
参数指定胡须的范围。默认值为 1.5.
whis : float, sequence, or string (default = 1.5)
As a float, determines the reach of the whiskers to the beyond the first and third quartiles. In other words, where IQR is the interquartile range (Q3-Q1), the upper whisker will extend to last datum less than Q3 + whisIQR). Similarly, the lower whisker will extend to the first datum greater than Q1 - whisIQR. Beyond the whiskers, data are considered outliers and are plotted as individual points. Set this to an unreasonably high value to force the whiskers to show the min and max values. Alternatively, set this to an ascending sequence of percentile (e.g., [5, 95]) to set the whiskers at specific percentiles of the data. Finally, whis can be the string 'range' to force the whiskers to the min and max of the data.
默认的胡须范围是 1.5* 四分位距。实际上,这意味着在使用默认值时,任何低于 Q1 - 1.5* 四分位距的值和高于 Q3 + 1.5* 四分位距的任何值都将被视为异常值。
给定一个非默认值,输出将针对该值进行调整。