skewness z 分数

重点 (Top highlight)

Most of the time I write longer articles on data science topics but recently I’ve been thinking about writing small, bite-sized pieces around specific concepts, algorithms and applications. This is my first attempt in that direction, hoping people will like these pieces.

大多数时候,我都会撰写有关数据科学主题的较长文章,但最近我一直在考虑围绕特定概念,算法和应用程序编写小巧的文章。 这是我朝这个方向的第一次尝试,希望人们会喜欢这些作品。

In today’s “small-bite” I’m writing about Z-score in the context of anomaly detection.

在当今的“小叮咬”中,我是在异常检测的背景下编写有关Z分数的文章。

Anomaly detection is a process for identifying unexpected data, event or behavior that require some examination. It is a well-established field within data science and there is a large number of algorithms to detect anomalies in a dataset depending on data type and business context. Z-score is probably the simplest algorithm that can rapidly screen candidates for further examination to determine whether they are suspicious or not.

异常检测是识别需要检查的意外数据,事件或行为的过程。 这是数据科学领域一个公认的领域,根据数据类型和业务环境,有大量算法可以检测数据集中的异常。 Z评分可能是最简单的算法,可以快速筛选候选人以进行进一步检查,以确定他们是否可疑。

What is Z-score

什么是Z分数

Simply speaking, Z-score is a statistical measure that tells you how far is a data point from the rest of the dataset. In a more technical term, Z-score tells how many standard deviations away a given observation is from the mean.

简而言之,Z分数是一种统计量度,可告诉您数据点与数据集其余部分的距离。 用一个更专业的术语,Z分数可以告诉给定观察值与平均值之间有多少标准偏差。

For example, a Z score of 2.5 means that the data point is 2.5 standard deviation far from the mean. And since it is far from the center, it’s flagged as an outlier/anomaly.

例如,Z得分为2.5意味着数据点是远离平均值的2.5标准偏差。 而且由于距离中心较远,因此将其标记为离群值/异常。

How it works?

这个怎么运作?

Z-score is a parametric measure and it takes two parameters — mean and standard deviation.

Z分数是一个参数度量,它包含两个参数-平均值和标准偏差。

Once you calculate these two parameters, finding the Z-score of a data point is easy.

一旦计算了这两个参数,就很容易找到数据点的Z分数。

Note that mean and standard deviation are calculated for the whole dataset, whereas x represents every single data point. That means, every data point will have its own z-score, whereas mean/standard deviation remains the same everywhere.

请注意,均值和标准差是针对整个数据集计算的,而x表示每个单个数据点。 这意味着,每个数据点将具有其自己的z分数,而平均值/标准差在各处均保持相同。

Example

Below is a python implementation of Z-score with a few sample data points. I’m adding notes in each line of code to explain what’s going on.

以下是带有一些示例数据点的Z分数的python实现。 我在每行代码中添加注释,以解释发生了什么。

# import numpyimport numpy as np# random data points to calculate z-scoredata = [5, 5, 5, -99, 5, 5, 5, 5, 5, 5, 88, 5, 5, 5]# calculate meanmean = np.mean(data) # calculate standard deviationsd = np.std(data)# determine a threholdthreshold = 2# create empty list to store outliersoutliers = []# detect outlierfor i in data:     z = (i-mean)/sd # calculate z-score    if abs(z) > threshold:  # identify outliers        outliers.append(i) # add to the empty list# print outliers    print("The detected outliers are: ", outliers)

Caution and conclusion

警告和结论

If you play with these data you will notice a few things:

如果您使用这些数据,您会注意到以下几点:

  • There are 14 data points and Z-score correctly detected 2 outliers [-99 and 88]. However, if you remove five data points from the list it detects only 1 outlier [-99]. That means you need to have a certain number of data size for Z-score to work.有14个数据点,Z分数正确检测到2个异常值[-99和88]。 但是,如果从列表中删除五个数据点,它将仅检测到1个异常值[-99]。 这意味着您需要具有一定数量的数据大小才能使Z评分工作。
  • In large production datasets, Z-score works best if data are normally distributed (aka. Gaussian distribution).在大型生产数据集中,如果数据呈正态分布(也称为高斯分布),则Z得分效果最佳。
  • I used an arbitrary threshold of 2, beyond which all data points are flagged as outliers. The rule of thumb is to use 2, 2.5, 3 or 3.5 as threshold.我使用了一个任意阈值2,超过该阈值所有数据点都被标记为离群值。 经验法则是使用2、2.5、3或3.5作为阈值。
  • Finally, Z-score is sensitive to extreme values, because the mean itself is sensitive to extreme values.

    最后, Z值对极值敏感,因为平均值本身对极值敏感 。

Hope this was useful, feel free to get in touch via Twitter.

希望这是有用的,请随时通过Twitter与我们联系。

翻译自: https://towardsdatascience.com/z-score-for-anomaly-detection-d98b0006f510

skewness z 分数


http://www.taodudu.cc/news/show-3693688.html

相关文章:

  • 偏度因子(skewness)——投资组合分析(EAP.portfolio_analysis)
  • Skewness
  • 偏度(skewness)和峰度(kurtosis)
  • 偏度(skewness)
  • 峰度(Kurtosis)和偏度(Skewness)
  • Window 7 iis配置webpage Razor运行环境
  • 【android】BridgeWebView加载本地h5出现webpage not available
  • Android模拟器Webview打开网页报webpage not available
  • webpage结合Vue Loader打包单文件组件
  • Android studio调用webview出现Webpage not available
  • windows_用命令行/终端打开网页(url)(launch a webpage by winodws CLI)
  • 解决genymotion使用内置浏览器访问网页Webpage not available的问题
  • 使用WebView时错误:WebPage not available
  • Nutch2 WebPage 字段解释
  • Webpage not available err_cleartext_not_permitted
  • [转载]Struts Web开发框架WebPage3
  • MSQL Webpage
  • 安卓上使用 WebView 提示:Webpage not available 的解决办法
  • android webpage err_unknown_url_scheme
  • webpage vue-cli 脚手架安装搭建
  • vue26 —— webpage使用 -- 配置
  • No webpage was found for the web address
  • webpage_webpagenotavailble
  • 2021-11-12 安装webpage
  • phontomjs webpage模块属性
  • phontomjs webPage模块方法
  • WebPage
  • JavaWeb page指令
  • webpage基本使用
  • Web之page分页表格数据

skewness z 分数_z分数用于异常检测相关推荐

  1. 用于异常检测的深度神经网络模型融合

    用于异常检测的深度神经网络模型融合 在当今的数字时代,网络安全至关重要,因为全球数十亿台计算机通过网络连接.近年来,网络攻击的数量大幅增加.因此,网络威胁检测旨在通过观察一段时间内的流量数据来检测这些 ...

  2. Auto Encoder用于异常检测

    对基于深度神经网络的Auto Encoder用于异常检测的一些思考 from:https://my.oschina.net/u/1778239/blog/1861724 一.前言 现实中,大部分数据都 ...

  3. 四分数与3σ准则异常检测效果图

    代码 代码没有哈哈哈

  4. 如何二值图转化为灰度图_AAAI 2020 | 时序转化为图用于可解释可推理异常检测

    本文首发于微信公众号:时序人,关注获取更佳阅读体验 作者 | 文杰 时间序列表示学习旨在学习一个将原始时间序列自动转换为向量表示的函数,是时间序列领域研究的基本问题.近年来,将时序进行分段并学习特征表 ...

  5. 《异常检测——从经典算法到深度学习》7 基于条件VAE异常检测

    <异常检测--从经典算法到深度学习> 0 概论 1 基于隔离森林的异常检测算法 2 基于LOF的异常检测算法 3 基于One-Class SVM的异常检测算法 4 基于高斯概率密度异常检测 ...

  6. 时间序列及异常检测综述(资料)

    文章目录 1. 背景 2. 时间序列预测方法 3. ARIMA 3.1 ARIMA模型预测的流程 3.2 学习资料 4. Prophet 4.1 Prophet流程 4.2 Prophet注意 4.3 ...

  7. 【机器学习】异常检测

    前言 异常检测实际案例:网络安全中的攻击检测,金融交易欺诈检测,疾病侦测,和噪声数据过滤等.时间序列的异常又分为点异常和模式异常. 对于一个新观测值进行判断: 离群点检测: 训练数据包含离群点,即远离 ...

  8. 异常检测FastFlow论文详解

    FastFlow 论文链接 https://arxiv.org/pdf/2111.07677v2.pdf Figure 1 : FastFlow的一个例子. FastFlow将输入图像的特征从原始分布 ...

  9. 基于GAN框架的时间序列异常检测研究综述

    一项综述类的课程作业 Anomaly detection with generative adversarial networks for multivariate time series. MAD- ...

最新文章

  1. python 常见的元字符(\d,\w ,^ ,$ 等) 的使用
  2. 精心挑选12款优秀的 JavaScript 日历和时间选择插件
  3. Jquery操作下拉列表和复选框,自定义下拉
  4. 【Codeforces】CF 5 C Longest Regular Bracket Sequence(dp)
  5. EF 如何更新多对多关系的实体
  6. Struts2中访问HttpServletRequest和HttpSession
  7. html5 密码框明文,elementUI的密码框的密文和明文
  8. ES6-类-ES6新增的类的概念
  9. Linux 内核设备属性
  10. 饭卡问题(0-1背包的变形)
  11. 【MYSQL笔记】MYSQL监视器
  12. myeclipse包导入项目lib下无效
  13. Flink on YARN(下):常见问题与排查思路
  14. 重新认识下科技核心目录吧!附容易发的期刊名单
  15. 2017 CCPC Final小结 By JSB @ Reconquista
  16. abb机器人伺服电机报闸是什么_什么是抱闸电机
  17. 安卓设备连接USB打印机
  18. Roslyn 使用 Target 替换占位符方式生成 nuget 打包
  19. 了解方差、标准差和极差
  20. Python报错解决:local variable ‘xxx‘ referenced before assignment

热门文章

  1. 轻量的、可自定义 CSS 的 Lightbox 相册插件
  2. 最佳答案 html5中不使用这些属性,[东北师范大学]《《HTML5开发基础与应用》2019年11月考试期末作业考核(100分)...
  3. 蓦然认知龚思颖:我不是“别人家的孩子”丨Xtecher 特写
  4. AVPlayer支持的视频格式
  5. 当初是你要分开 分开就分开
  6. Calendar:日历图
  7. Hive DQL数据查询函数
  8. 【大数据】大数据 Hadoop 管理工具 Apache Ambari(HDP)
  9. cocos2d-x AR实景游戏实现
  10. html enctype 属性,HTMLbutton标签 formenctype 属性