Skip to Content
精通機器學習
book

精通機器學習

by Aurélien Géron
April 2020
Intermediate to advanced
816 pages
18h 32m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習
182
|
第六章:決策樹
下一章會介紹
隨機森林可以藉著計算多棵樹的預測平均值來約束這個不穩定性
習題
1. 用含有 100 萬個實例的訓練組來訓練(沒有限制)的決策樹的深度大概是多少?
2. 一個節點的 Gini 不純度通常會低於還是高於它的父節點的?它是
通常
較低 / 較高,
還是
一定
較低 / 較高?
3. 如果決策樹過擬訓練組,試著降低
max_depth
是好方法嗎?
4. 如果決策樹欠擬訓練組,試著調整輸入特徵尺度是好方法嗎?
5. 如果用含有 100 萬個實例的訓練組來訓練決策樹需要 1 個小時,用含有 1,000 萬個
實例的訓練組來訓練另一個決策樹大概需要多久?
6. 如果你的訓練組有 100,000 個實例,設定
presort=True
可提高訓練速度嗎?
7. 用下面的步驟來訓練與微調 moons 資料組的決策樹:
a. 使用
make_moons(n_samples=10000, noise=0.4)
來產生一個 moons 資料組。
b. 使用
train_test_split()
來將資料組拆成訓練組與測試組。
c. 使用網格搜尋與交叉驗證(以
GridSearchCV
類別)來找出好的
DecisionTreeClassifier
超參數值。提示:嘗試各種
max_leaf_nodes
值。
d. 使用這些超參數和完整的訓練組來訓練它,並且用測試組來評量模型的效果。你
應該會得到 85% 87% 的準確度。
8. 用下面的步驟來種一座森林:
a. 延續上一個習題,製作訓練組的
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

下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9789865024345