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
6
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
66
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
77
LLM + 強化学習
nearme_tech
PRO
0
34
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
100
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
69
初めてのLean言語
nearme_tech
PRO
0
110
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
47
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
86
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
690
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
930
A Tale of Four Properties
chriscoyier
163
24k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
350
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
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