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 版)
无监督学习技术
227
都是其集群的代表图像。让我们看看性能是否更好:
>>>
log_reg = LogisticRegression()
>>>
log_reg.fit(X_representative_digits, y_representative_digits)
>>>
log_reg.score(X_test, y_test)
0.9222222222222223
哇!尽管我们仍然仅在 50 个实例上训练模型,但准确性从 83.3% 跃升至 92.2%。由于
标记实例通常很昂贵且很痛苦,尤其是当必须由专家手动完成时,标记代表性实例(而
不是随机实例)是一个好主意。
但是也许我们可以更进一步:如果将标签传播到同一集群中的所有其他实例,会怎么样?
这称为标签传播:
y_train_propagated = np.empty(len(X_train), dtype=np.int32)
for
i
in
range(k):
y_train_propagated[kmeans.labels_==i] = y_representative_digits[i]
再次训练模型并查看其性能:
>>>
log_reg = LogisticRegression()
>>>
log_reg.fit(X_train, y_train_propagated)
>>>
log_reg.score(X_test, y_test)
0.9333333333333333
我们获得了合理的精度提升,这不让人惊奇。问题在于,我们把每个代表性实例的标 ...
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

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

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

George T.Heineman, Gary Pollice, Stanley Selkow
Go语言编程

Go语言编程

威廉·肯尼迪
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977