Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
无监督学习技术
|
237
图 9-18:束状集群(左)和球形集群(右)的高斯混合
9.2.1 使用高斯混合进行异常检测
异常检测(也称为离群值检测)是检测严重偏离标准的实例的任务。这些实例称为异常
或离群值,而正常实例称为内值。异常检测在各种应用中很有用,例如欺诈检测,在制
造业中检测有缺陷的产品,或在训练一个模型之前从数据集中删除异常值(这可以显著
提高所得模型的性能)。
使用高斯混合模型进行异常检测非常简单:位于低密度区域的任何实例都可以被视为异
常。你必须定义要使用的密度阈值。例如,在试图检测缺陷产品的制造业公司中,缺陷
产品的比例通常是已知的,假设它等于 4%。将密度阈值设置为导致 4% 的实例位于该阈
值密度以下的区域中的值。如果你发现误报过多(即标记为有缺陷的好产品),则可以降
低阈值。相反,如果假负过多(即系统未将其标记为次品的次品),则可以提高阈值。这
是通常的精度 / 召回的权衡(见第 3 章)。以下是使用最低 4% 的密度作为阈值来识别异
常值的方法(即大约 4% 的实例被标记为异常):
densities = gm.score_samples(X)
density_threshold = np.percentile(densities, 4)
anomalies = X[densities < density_threshold]
图 9-19 中将这些异常值表示为星号。
一个与之密切相关的任务是新颖性检测,它与异常检测不同之处在于,该算法被假定为
在“干净”的数据集上训练的,不受异常值的污染 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977