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
100
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
84
Confusion matrix
ysunmi0427
0
140
심슨의 역설
ysunmi0427
0
2k
회사는 어떤 사람을 데이터 분석가로 채용하고 싶어하는 것일까?
ysunmi0427
0
2k
Other Decks in Technology
See All in Technology
フルカイテン株式会社 採用資料
fullkaiten
0
40k
20241108_CS_LLMMT
shigashiyama
0
260
SREの組織類型に応じた リーダシップの考察
kenta_hi
PRO
1
640
元旅行会社の情シス部員が教えるおすすめなre:Inventへの行き方 / What is the most efficient way to re:Invent
naospon
2
310
Intuneお役立ちツールのご紹介
sukank
3
770
Amazon CloudWatch Network Monitor のススメ
yuki_ink
0
170
인디 앱 개발자와 Flutter
tinyjin
0
160
エンジニアが一生困らない ドキュメント作成の基本
naohiro_nakata
3
170
第23回Ques_タイミーにおけるQAチームの在り方 / QA Team in Timee
takeyaqa
0
270
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
31
8.2k
利きプロセススケジューラ
sat
PRO
5
2.7k
ライブラリでしかお目にかかれない珍しい実装
mikanichinose
2
340
Featured
See All Featured
Code Review Best Practice
trishagee
64
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
Rails Girls Zürich Keynote
gr2m
94
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
The World Runs on Bad Software
bkeepers
PRO
65
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Adopting Sorbet at Scale
ufuk
73
9.1k
KATA
mclloyd
29
14k
How to Ace a Technical Interview
jacobian
276
23k
It's Worth the Effort
3n
183
27k
We Have a Design System, Now What?
morganepeng
50
7.2k
How GitHub (no longer) Works
holman
310
140k
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