Skip to Main Content
机器学习设计模式
book

机器学习设计模式

by Valliappa Lakshmanan, Sara Robinson, Michael Munn
September 2022
Beginner to intermediate content levelBeginner to intermediate
386 pages
7h 36m
Chinese
Southeast University Press
Content preview from 机器学习设计模式
30
2
2
-
4
:左图:维基百科页面浏览量的分布严重偏斜,动态范围很大。 第二个图表明可以通
过使用对数、幂函数和连续线性缩放以变换浏览量来解决问题。第三个图显示了直方图均衡
化的效果。第四个图显示了 Box-Cox 变换的效果。
很难设计一个线性化函数,使分布看起来像钟形曲线。一个更简单的方法是对浏览
量进行桶化(
bucketize
),选择桶边界以适合所需的输出分布。选择这些存储桶的
原则是进行直方图均衡化,其中直方图的组距(
bin
)是根据原始分布的分位数来选
择的(参见图
2-4
中的第三个图)。在理想情况下,直方图均衡化会导致均匀分布(尽
管在这个例子中不是这样,因为分位数中存在重复值)。
要在
BigQuery
中进行直方图均衡化,我们可以执行以下操作:
ML.BUCKETIZE(num_views, bins) AS bin
从以下位置获得组距:
APPROX_QUANTILES(num_views, 100) AS bins
有关详细信息请参阅本书代码存储库中的
Jupyter notebook
https://github.com/
GoogleCloudPlatform/ml-design-patterns/blob/master/02_data_representation/simple_
data_representation.ipynb
)。
处理偏态分布的另一种方法是使用参数变换技术,例如
Box-Cox
变换。
Box-Cox
择它的一个参数
lambda
来控制“异方差”(
heteroscedasticity ...
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.
Start your free trial

You might also like

PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Rust程序设计

Rust程序设计

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall

Publisher Resources

ISBN: 9787564196776