Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
EnsembleDecisionTree
Search
yuki
February 21, 2021
11k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EnsembleDecisionTree
yuki
February 21, 2021
More Decks by yuki
See All by yuki
240315_発表資料_清水.pdf
yuyumoyuyu
2
830
230315_symposium
yuyumoyuyu
1
590
220305_kenkyukai
yuyumoyuyu
3
180
221124_kenkyukai
yuyumoyuyu
1
590
voltageequation5
yuyumoyuyu
2
12k
210910_kenkyukai
yuyumoyuyu
1
330
210826_bumontaikai
yuyumoyuyu
0
230
voltageequation4
yuyumoyuyu
33
15k
210518_iemdc
yuyumoyuyu
0
180
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.9k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
Everyday Curiosity
cassininazir
0
250
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Faster Mobile Websites
deanohume
310
32k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
The Curious Case for Waylosing
cassininazir
1
430
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
450
Accessibility Awareness
sabderemane
1
150
Transcript
決定木のアンサンブル法 ・ランダムフォレスト ・勾配ブースティング決定木 Decision Tree Ensemble -Random Forest -Gradient Boosting
Decision Tree 大阪府立大学 工学研究科 清水 悠生
2 はじめに ✓ 本記事は決定木↓の理解を前提に書いています ✓ https://yuyumoyuyu.com/2021/02/07/decisiontree/ ✓ 具体的な解析結果やPythonプログラムは GitHubを参照してください ✓
https://github.com/yshimizu12/EnsembleDecisionTree
3 アンサンブル学習とは ✓ 同一のデータセットから複数の学習器を学習し その結果を統合して汎化能力を向上する方法 ⇒アンサンブル学習 データ セット 予測 結果
学習器1 学習器2 学習器n …
4 2種類の決定木アンサンブル学習 ✓ 決定木は汎化性能が低いため, アンサンブル学習を利用することがほとんど ✓ 決定木アンサンブル学習は下記の2つが代表的 ⚫ ランダムフォレスト ⚫
勾配ブースティング決定木
5 ランダムフォレスト ✓ あるデータセットからサブデータセットを複数作成し それぞれを使って独立した決定木を学習し 学習結果を統合するモデル⇒ランダムフォレスト データ セット 予測 結果
決定木1 決定木2 決定木n … サブ データ1 予測1 サブ データ2 予測2 サブ データn 予測n
6 サブデータセットの作り方 ✓ データセットから重複ありでデータを抽出し, データセットと同じサイズのサブデータをn個生成する ✓ ブートストラップサンプリングと呼ぶ データセット No. 寸法1
寸法2 寸法3 トルク 1 5 mm 6 mm 2 mm 3 Nm 2 3 mm 7 mm 1 mm 4 Nm 3 2 mm 5 mm 1 mm 2 Nm 4 4 mm 6 mm 2 mm 5 Nm No. 寸法1 寸法2 寸法3 トルク 1 5 6 2 3 2 3 7 1 4 1 5 6 2 3 3 2 5 1 2 No. 寸法1 寸法2 寸法3 トルク 4 4 6 2 5 4 4 6 2 5 1 5 6 2 3 1 5 6 2 3 No. 寸法1 寸法2 寸法3 トルク 3 2 5 1 2 2 3 7 1 4 4 4 6 2 5 3 2 5 1 2 サブデータセット1 サブデータセット2 サブデータセット3
7 決定木で使用する特徴量選択 ✓ ランダムフォレストが高い汎化性能を有するには 決定木同士が異なる構造を持つほうがよい ✓ 特徴量をランダムに選択して学習を行う No. 寸法1 寸法2
寸法3 トルク 1 5 6 2 3 2 3 7 1 4 1 5 6 2 3 3 2 5 1 2 No. 寸法1 寸法2 寸法3 トルク 4 4 6 2 5 4 4 6 2 5 1 5 6 2 3 1 5 6 2 3 No. 寸法1 寸法2 寸法3 トルク 3 2 5 1 2 2 3 7 1 4 4 4 6 2 5 3 2 5 1 2 サブデータセット1 サブデータセット2 サブデータセット3 No. 寸法2 寸法3 トルク 1 6 2 3 2 7 1 4 1 6 2 3 3 5 1 2 No. 寸法1 寸法3 トルク 4 4 2 5 4 4 2 5 1 5 2 3 1 5 2 3 No. 寸法1 寸法2 トルク 3 2 5 2 2 3 7 4 4 4 6 5 3 2 5 2
8 各決定木の結果の統合 ✓ 各決定木の出力を統合する方法は下記の通り ⚫ 回帰:各決定木の平均値 ⚫ 分類:各決定木の出力ラベルの確率平均により決定 A: 60%
B: 40% 決定木1 決定木2 決定木3 A: 70% B: 30% A: 65% B: 35% A: 45% B: 55% A! 2クラス分類の例
9 勾配ブースティング決定木 ✓ 構築した決定木の損失関数の結果から 予測誤差を減らすように次々と決定木を構築・学習し 学習結果を統合するモデル⇒勾配ブースティング決定木 データ セット 予測 結果
決定木1 決定木2 決定木n … 予測1 予測2 予測n 予測 誤差1 予測 誤差1 予測 誤差2 予測 誤差n-1 … …
10 勾配ブースティング決定木のアルゴリズム ✓ 勾配ブースティング決定木のアルゴリズムは下記の通り 1. 最初の決定木を構築 2. 真値に対する誤差を計算(実際は誤差関数の勾配) 3. 誤差を利用して,誤差が小さくなるよう木を構築
4. 2,3を繰り返す 1 2 t … + + + + = ො 𝑦1 = ො 𝑦2 = ො 𝑦𝑡 Step.1 決定木を構築 ො 𝑦𝑡 真値 𝑦 ො 𝑦2 ො 𝑦1 0 1 2 t Step.2 誤差を 計算 Step.3 誤差から新たな木を構築
11 よく使われる手法 ✓ Pythonでは勾配ブースティングの派生として 高精度かつ学習時間が短い下記がよく用いられる ⚫ XGBoost ⚫ LightGBM ✓
実装例はこちら↓ ✓ https://github.com/yshimizu12/EnsembleDecisionTree