Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
フルスクラッチで最強の決定木を実装する
Search
NearMeの技術発表資料です
PRO
December 22, 2023
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
フルスクラッチで最強の決定木を実装する
NearMeの技術発表資料です
PRO
December 22, 2023
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
AIエージェントのための 隔離された安全なインフラ設計
nearme_tech
PRO
0
23
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
69
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
79
LLM + 強化学習
nearme_tech
PRO
0
37
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
110
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
71
初めてのLean言語
nearme_tech
PRO
0
110
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
50
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
93
Featured
See All Featured
Music & Morning Musume
bryan
48
7.4k
The Language of Interfaces
destraynor
162
27k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Writing Fast Ruby
sferik
630
63k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Navigating Weather and Climate Data
rabernat
0
560
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
Code Review Best Practice
trishagee
74
20k
My Coaching Mixtape
mlcsv
0
360
Transcript
0 2023-12-22 第72回NearMe技術勉強会 Takuma Kakinoue フルスクラッチで最強の決定⽊を実装する
1 はじめに • ⼤きな⽬標 ◦ 最強の決定⽊をフルスクラッチで作る! • 前回まで ◦ ランダムフォレストの実装を⾏った
▪ https://speakerdeck.com/nearme_tech/jue-ding-mu-woshi-zhuang-suru • 今回のスコープ ◦ ⾃作ランダムフォレストの性能評価および改善ポイントの考察
2 性能評価⽅法 • Kaggleの常設の⼊⾨コンテスト「Spaceship Titanic」のデータセットを使う ◦ https://www.kaggle.com/competitions/spaceship-titanic • Spaceship Titanicの主な特徴
◦ チュートリアル問題として有名な「Titanic」の派⽣コンテスト ◦ 本家「Titanic」よりデータ数が多いが,⽋損値も多い • ⾃作RandomForestで学習して性能を評価する ◦ ⾃作RandomForestの実装コード ▪ https://github.com/kakky-hacker/algorithm_sandbox ◦ ⽐較対象は,scikit-learnのRandomForestClassifier ▪ https://github.com/scikit-learn/scikit-learn/tree/main
3 結果 簡単な⽋損値処理とラベルエンコーディングだけを⾏い,学習させた。 ↓ ⾃作RandomForest ↓ scikit-learnのRandomForestClassifier accuracy:0.77951 accuracy:0.78606
4 考察 scikit-learnのRandomForestにaccuracyで 0.6% ほど負けてしまった。 ただ,アルゴリズムの実装⾃体は問題なくできてそう。 結果に対する考察 • ⾃作RandomForestは計算速度が圧倒的に遅かった(数100倍レベル) ◦
よって,⽊の数や深さをそこまで拡張できなかったので若⼲精度が下がった可能性 今後の展望 • 計算速度を上げる⼯夫をする ◦ 計算が重い処理の特定および改善 • Borutaなどの特徴量選択アルゴリズムを導⼊ ◦ 実装済みではあるが,現状,計算速度がネックとなって,使えていない • 勾配ブースティングを導⼊ ◦ ブースティングの仕組みを理解し実装
5 計算速度の改善ポイント 右のコードは,エッジの最適な分岐を 算出する関数である。 全特徴量に対して,ユニークな値全て を順番に調べているので⾮効率。 ↓ scikit-learnのソースコードを 解析して,知⾒を得る。 https://github.com/kakky-hacker/algorithm_sandbox/blob/main/decision_tree/core.py
6 Thank you