How to detect outliers in an 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." Example: 100 105 102 13 104 22 101 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? 回答1: 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