如何检测 ArrayList 中的异常值 [英] How to detect outliers in an ArrayList

查看:31
本文介绍了如何检测 ArrayList 中的异常值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在想一些代码,让我可以搜索我的 ArrayList 并检测好值"的共同范围之外的任何值.

I'm trying to think of some code that will allow me to search through my ArrayList and detect any values outside the common range of "good values."

示例:1001051021310422101

Example: 100 105 102 13 104 22 101

我如何编写代码来检测(在本例中)13 和 22 不在 100 左右的良好值"范围内?

How would I be able to write the code to detect that (in this case) 13 and 22 don't fall within the "good values" of around 100?

推荐答案

几个标准 用于检测异常值.最简单的,如Chauvenet 标准,使用从样本计算的均值和标准差确定值的正常"范围.任何超出此范围的值都被视为异常值.

There are several criteria for detecting outliers. The simplest ones, like Chauvenet's criterion, use the mean and standard deviation calculated from the sample to determine a "normal" range for values. Any value outside of this range is deemed an outlier.

其他标准是 Grubb's testDixon 的 Q 检验,并且可能会给出比 Chauvenet 更好的结果,例如,如果样本来自偏斜分布.

Other criterions are Grubb's test and Dixon's Q test and may give better results than Chauvenet's for example if the sample comes from a skew distribution.

这篇关于如何检测 ArrayList 中的异常值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆