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 机器学习设计模式
问题表示设计模式
97
3
-
9
:通过将问题分解为更小的二元分类任务来理解多标签模式。
所谓阈值,指的是我们可以接受的、用于确认一个输入属于特定类别的概率。
例如,如果我们构建一个模型来对图像中不同类型的动物进行分类,我们可
能会很自信地说一张图片里有一只猫,即使模型只有
80%
的置信度认为这
张图片里有一只猫。或者,如果我们要构建一个进行医疗预测的模型,我们
很可能希望模型在确定具体医疗状况是否出现的预测置信度接近
99%
。虽然
阈值是我们在设计任何类型的分类模型时都需要考虑的,但它与多标签设计
模式特别相关,因为我们需要为每个类别确定阈值,并且它们可能是不同的。
让我们来看一个具体的例子,用
BigQuery
中的
Stack Overflow
数据集来构建一个模
型,在只给定标题的情况下预测与
Stack Overflow
问题相关联的标签。为了简单起见,
我们把数据集限制为只包含
5
个标签的问题:
SELECT
title,
REPLACE(tags, "|", ",") as tags
FROM
`bigquery-public-data.stackoverflow.posts_questions`
WHERE
REGEXP_CONTAINS(tags,
r"(?:keras|tensorflow|matplotlib|pandas|scikit-learn)")
我们的模型的输出层如下所示(本节的完整代码详见
GitHub
存储库,
https://github.
com/GoogleCloudPlatform/mldesign-patterns/blob/master/03 ...
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