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
Tree Methods
Search
Sunmi Yoon
November 04, 2019
Technology
0
110
Tree Methods
Decision Tree, Random Forest를 dataitgirls3 학생들에게 가르치기 위해 만든 수업자료입니다.
Sunmi Yoon
November 04, 2019
Tweet
Share
More Decks by Sunmi Yoon
See All by Sunmi Yoon
데이터 분석가 채용 공고 읽는 방법
ysunmi0427
1
320
Deep down in classification 0.5 magic number
ysunmi0427
0
90
Confusion matrix
ysunmi0427
0
140
심슨의 역설
ysunmi0427
0
2.1k
회사는 어떤 사람을 데이터 분석가로 채용하고 싶어하는 것일까?
ysunmi0427
0
2.2k
Other Decks in Technology
See All in Technology
サーバシステムを無理なくコンテナ移行する際に伝えたい4つのポイント/Container_Happy_Migration_Method
ozawa
1
100
OPENLOGI Company Profile for engineer
hr01
1
22k
パスキー導入の課題と ベストプラクティス、今後の展望
ritou
7
1.2k
Security response for open source ecosystems
frasertweedale
0
100
Explainable Software Engineering in the Public Sector
avandeursen
0
370
Symfony in 2025: Scaling to 0
fabpot
2
210
ルートユーザーの活用と管理を徹底的に深掘る
yuobayashi
6
730
Dapr For Java Developers SouJava 25
salaboy
1
130
Road to SRE NEXT@仙台 IVRyの組織の形とSLO運用の現状
abnoumaru
0
400
20250326_管理ツールの権限管理で改善したこと
sasata299
1
390
コード品質向上で得られる効果と実践的取り組み
ham0215
2
200
大規模アジャイル開発のリアル!コミュニケーション×進捗管理×高品質
findy_eventslides
0
570
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
12
1.4k
Into the Great Unknown - MozCon
thekraken
36
1.7k
Optimising Largest Contentful Paint
csswizardry
35
3.2k
Visualization
eitanlees
146
16k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
The Invisible Side of Design
smashingmag
299
50k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
28
1.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
610
Designing for Performance
lara
606
69k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Transcript
Tree methods dataitgirls3 Instructor Sunmi Yoon
Decision Tree
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead Root Node (ࡸܻ) Intermediate Node (о) Terminal Node, Leaf ()
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead അ ਤী ؘఠо ݻ ѐ ਤ೧ ח Ӓ ؘఠٜ যڃ ۄ߰ਸ оҊ ח
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead যڃ ӝળਵ۽ оӝܳ ೮ח (gini ژח entropy)
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead Terminal Nodeী بೠ ؘఠٜਸ যڌѱ ࠙ܨೡ Ѫੋ
sklearn Code
Impurity
Impurity ࢎѾաޖח Impurity (ࠛࣽب, ࠛഛपࢿ) ծইח ߑߨਵ۽ णפ. ࣽبо ૐоೞח
Ѫਸ فҊ Information gainۄҊ ೞӝب פ. য়ט ࢎѾաޖ ࠛࣽب ஏ ߑߨ , Gini Indexܳ ҕࠗפ.
Sex <= 0.5 gini = 0.473 samples = 891 value
= [549, 342] class = Survived Fare <= 26.269 gini = 0.306 samples = 577 value = [468, 109] class = Survived True Fare <= 48.2 gini = 0.383 samples = 314 value = [81, 233] class = Dead False gini = 0.226 samples = 415 value = [361, 54] class = Survived gini = 0.448 samples = 162 value = [107, 55] class = Survived gini = 0.447 samples = 225 value = [76, 149] class = Dead gini = 0.106 samples = 89 value = [5, 84] class = Dead G = d ∑ i=1 Ri ( 1 − m ∑ k=1 p2 ik) Step 1. gini = 0.473 ਸ ҅೧ যࠁࣁਃ Step 2. gini = 0.226 ਸ ҅೧ যࠁࣁਃ
https://imgur.com/n3MVwHW
Random Forest
ৈ۞ ܻٜਸ ‘ܰѱ’ ݅ٚ. https://www.researchgate.net/figure/Architecture-of-the-random-forest-model_fig1_301638643
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Seeing-the-Forest-for-the-Trees-An-Introduction-to-Random-Forest/ta-p/158062 bagging = bootstrap aggregating
Bagging ߓӦ(bagging) bootstrap aggregating ড۽, ࠗझە(bootstrap)ਸ ా೧ ઑӘঀ ܲ ള۲
ؘఠী ೧ ള۲ػ ӝୡ ࠙ܨӝ(base learner)ٜਸ Ѿ(aggregating)दఃח ߑߨ. ࠗझەۆ, য ള۲ ؘఠীࢲ ࠂਸ ೲਊೞৈ ਗ ؘఠࣇҗ э ӝ ؘఠࣇਸ ݅٘ח җਸ ݈ೠ. ߓӦਸ ా೧ ےؒ ನۨझܳ ള۲दఃח җ җ э ࣁ ױ҅۽ ೯ػ. 1. ࠗझە ߑߨਸ ా೧ Nѐ ള۲ ؘఠࣇਸ ࢤࢿೠ. 2. Nѐ ӝୡ ࠙ܨӝ(ܻ)ٜਸ ള۲दఅ. 3. ӝୡ ࠙ܨӝ(ܻ)ٜਸ ೞա ࠙ܨӝ(ےؒ ನۨझ)۽ Ѿೠ(ಣӐ ژח җ߈ࣻై ߑध ਊ). Wikipedia ےؒನۨझ > ߓӦਸ ਊೠ ನۨझ ҳࢿ
sklearn Code