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 版)
172
|
第
6
章
6.10 练习题
1. 如果训练集有 100 万个实例,训练决策树(无约束)大致的深度是多少?
2. 通常来说,子节点的基尼不纯度是高于还是低于其父节点?是通常更高 / 更低?还
是永远更高 / 更低?
3. 如果决策树过拟合训练集,减少 max_depth 是否为一个好主意?
4. 如果决策树对训练集欠拟合,尝试缩放输入特征是否为一个好主意?
5. 如果在包含 100 万个实例的训练集上训练决策树需要一个小时,那么在包含 1000 万
个实例的训练集上训练决策树,大概需要多长时间?
6. 如果训练集包含 10 万个实例,设置 presort=True 可以加快训练吗?
7. 为卫星数据集训练并微调一个决策树。
a. 使用 make_moons(n_samples=10000,noise=0.4) 生成一个卫星数据集。
b. 使用 train_test_split() 拆分训练集和测试集。
c. 使用交叉验证的网格搜索(在 GridSearchCV 的帮助下)为 DecisionTree-
Classifier 找到适合的超参数。提示:尝试 max_leaf_nodes 的多种值。
d. 使用超参数对整个训练集进行训练,并测量模型在测试集上的性能。你应该得
到约 85%
~
87% 的准确率。
8. 按照以下步骤种植森林。
a. 继续之前的练习,生产 1000 个训练集子集,每个子集包含随机挑选的 100 个实
例。提示:使用 Scikit-Learn 的 ShuffleSplit 来实现。
b.
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