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
Confusion matrix
Search
Sunmi Yoon
November 03, 2019
Technology
0
140
Confusion matrix
Confusion matrix 기초부터 머신러닝 응용까지 for dataitgirls3
Sunmi Yoon
November 03, 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
Tree Methods
ysunmi0427
0
100
심슨의 역설
ysunmi0427
0
2k
회사는 어떤 사람을 데이터 분석가로 채용하고 싶어하는 것일까?
ysunmi0427
0
2.1k
Other Decks in Technology
See All in Technology
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
Wantedly での Datadog 活用事例
bgpat
1
250
第3回Snowflake女子会_LT登壇資料(合成データ)_Taro_CCCMK
tarotaro0129
0
180
テーブルが200以上あるSaaSでRSCとGraphQLを併用する理由
msickpaler
2
1.2k
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
520
5分でわかるDuckDB
chanyou0311
10
3.1k
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
1
900
2024年にチャレンジしたことを振り返るぞ
mitchan
0
120
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
400
WernerVogelsのKeynoteで語られた6つの教訓とOps
hatahata021
2
290
コンテナセキュリティのためのLandlock入門
nullpo_head
2
310
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Automating Front-end Workflow
addyosmani
1366
200k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.8k
Code Review Best Practice
trishagee
65
17k
Rails Girls Zürich Keynote
gr2m
94
13k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
It's Worth the Effort
3n
183
28k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Side Projects
sachag
452
42k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Transcript
Evaluation for classification dataitgirls3 Instructor Sunmi Yoon
Confusion Matrix
https://sumniya.tistory.com/26
Evaluation Metrics from Confusion Matrix
https://towardsdatascience.com/understanding-confusion-matrix-a9ad42dcfd62
Precision(ب), PPV(Positive Predictive Value) ݽ؛ TrueۄҊ ࠙ܨೠ Ѫ ী, पઁ
Trueੋ Ѫ ࠺ਯ Recall(അਯ), Sensitivity, hit rate पઁ True ী ݽ؛ True۽ ࠙ܨೠ ࠺ਯ “Precision݅ न҃ਸ ॳݶ ݽ؛ ੋ࢝೧Ҋ, Recall݅ न҃ॳݶ ݽ؛ ಌ” ܳ ࢤп೧ࠁࣁਃ.
Accuracy TP, TNਸ ݽف Ҋ۰ೞח . Label ࠛӐഋ बೡ ٸী
ࢎਊਸ ೧ঠ פ. F1 Score Precisionҗ Recall ઑചಣӐ Label ࠛӐഋ बೡ ٸী ݽ؛ ࢿמਸ ഛೞѱ ಣоೡ ࣻ णפ. Label ࠛӐഋ बೡ ٸী, Accuracyח ۽ࢲ न܉ࢿਸ णפ. ਬܳ ࢤп ೧ ࠁࣁਃ.
https://sumniya.tistory.com/26 ৵ ࣿಣӐ ইפҊ ઑചಣӐੋо?
ઑӘ݅ ؊ о ࠇद
https://towardsdatascience.com/understanding-confusion-matrix-a9ad42dcfd62 द Ӓܿਵ۽ جই৬ࢲ, ଘ ফܳ बਵ۽ ࢤп೮
https://towardsdatascience.com/understanding-confusion-matrix-a9ad42dcfd62 द Ӓܿਵ۽ جই৬ࢲ, ߣূ ফب э ࢤпೞݶࢲ ࠇद
(Әࠗఠ ഁтܾ ࣻ )
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
Precision Positive Predictive Value ࠙ܨ Ѿҗ(ݽ؛)ਸ बਵ۽
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
Negative Predictive Value ࠙ܨ Ѿҗ(ݽ؛)ਸ बਵ۽
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
Recall Sensitivity True Positive Rate ਸ बਵ۽
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
ਸ बਵ۽ False Positive Rate
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
ਸ बਵ۽ Specificity True Negative Rate
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
ਸ बਵ۽ Fall-out rate False Positive Rate
https://towardsdatascience.com/understanding-confusion-matrix-a9ad42dcfd62 Ѧ ೞҊ ೮ભ. ߣূ ফب э ࢤпೞݶࢲ ࠇद (Әࠗఠ
ഁтܾ ࣻ )
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
? TP ब ٜ ܻೞݶ, ?
TRUE FALSE ࠙ܨѾҗ TRUE TP FP FALSE FN TN
TN ब ٜ ? ܻೞݶ, ?
ഁтܻભ? ਗې Ӓ۠Ѣਃ
ӝୡח ೮ਵפө ઑӘ݅ ؊ ೧ ࠇद.
Confusion Matrix with Histogram
https://www.medcalc.org/manual/roc-curves.php Criterion, Threshold য়ܲଃ Distribution Actual True, ৽ଃ Actual False.
Threshold ਤ۽ח ݽف True۽ ஏೞח ݽ؛ Ҋ о೮ਸ ٸ,
https://www.medcalc.org/manual/roc-curves.php Thresholdܳ ӓױਵ۽ ஏ ز दெࠇद. যڃ ੌ ੌযաաਃ? Precision:
Recall: Specificity: Fall-out:
https://www.medcalc.org/manual/roc-curves.php Thresholdܳ ӓױਵ۽ ஏ ز दெࠇद. যڃ ੌ ੌযաաਃ? True
positive rate: True negative rate:
https://www.medcalc.org/manual/roc-curves.php ߣূ ߈۽ ز दெࠇद. যڃ ੌ ੌযաաਃ? True positive
rate: True negative rate:
Specificity৬ Sensitivity ҙ҅ https://www.medcalc.org/manual/roc-curves.php
ROC(Receiver Operating Characteristic) curve
рױೞѱח, Sensitivity৬ 1-Specificityܳ п ୷ਵ۽ ೞח 2ରਗ Ӓې https://www.medcalc.org/manual/roc-curves.php AUC
(Area Under Curve)
рױೞѱח, Sensitivity৬ 1-Specificityܳ п ୷ਵ۽ ೞח 2ରਗ Ӓې https://www.medcalc.org/manual/roc-curves.php Actual
True৬ Actual False distribution ৮߷ೞѱ эਸ ٸ (feature class ߸߹מ۱ হ) ROC curveח 45ب пب ࢶ
рױೞѱח, Sensitivity৬ 1-Specificityܳ п ୷ਵ۽ ೞח 2ରਗ Ӓې https://www.medcalc.org/manual/roc-curves.php Actual
True৬ Actual False distribution Ҁח হ ৮߷ೞѱ ܻ࠙ ؼ ٸ ROC ழ࠳ (feature class ߸߹ מ۱ ৮߷) ROC ழ࠳о ઝ࢚ױী оөࣻ۾ feature class ߸߹ מ۱ જҊ ೡ ࣻ .
ROC(Receiver Operating Characteristic) curve with Machine Learning
Classifierܳ ݅ٚח Ѥ, ف ѐ histogramਸ ӒܻҊ Thresholdܳ ೞח Ѫ
https://www.medcalc.org/manual/roc-curves.php
https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html#sphx-glr-auto-examples-model-selection-plot-roc-py Histogramਸ Ӓ۷ח Ѥ ROC ழ࠳ܳ Ӓܾ ࣻ ח Ѫ!
https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html#sphx-glr-auto-examples-model-selection-plot-roc-py ROC ழ࠳ܳ Ӓܾ ࣻ ח Ѥ ৈ۞ ROC ழ࠳
р ࠺Үܳ ా೧ જ ࢿמ ݽ؛ਸ ইյ ࣻ ח Ѫ!
AUCо = ݽ؛ ҅ೠ probabilityܳ ߄ఔਵ۽ Ӓܽ histogramٜ ੜ
ܻ࠙غয . = ݽ؛ Threshold(Decision BoundaryۄҊب ೠ)ী ؏ хೞ. = উੋ ஏਸ ೠ.
ݽ؛ ࢶఖী ROC ழ࠳ܳ ഝਊೠ = Decision Boundaryী ࢚ҙহ ؊
જ ݽ؛ਸ ח. = ganziо դ.
Ӓ۰ࠇद. ؘఠ: titanic ݽ؛ - sklearn.linear_model.LinearRegression - sklearn.linear_model.LogisticRegression -
sklearn.tree.DecisionTreeClassifier - sklearn.ensemble.RandomForestClassifier ١ whatever you want - Tree ҅ৌ ݽ؛ ҃ model predict_proba() ݫࣗ٘ܳ ࢎਊೞݶ ഛܫ ҅ ؾ פ. - ীח Thresholdܳ a ݅ఀ ز೧оݴ Sensitivity, Specificityܳ ҅೧ ઝܳ ҳೞ ࣁਃ. - যڌѱ ೞݶ Thresholdܳ ੜ زदఃݶࢲ ROC ઝܳ ନਸ ࣻ ਸөਃ? - ઝٜਸ ಣݶ࢚ী ନযࠁࣁਃ.
sklearn.metrics.roc_curve ܳ ഝਊ ೧ ࠇद. ؘఠ: titanic ݽ؛ - sklearn.linear_model.LinearRegression
- sklearn.linear_model.LogisticRegression - sklearn.tree.DecisionTreeClassifier - sklearn.ensemble.RandomForestClassifier ١ whatever you want ؊ աইоࢲ, - sklearnਸ ਊ೧ AUCب ҅ ೧ࠇद. - ৈ۞ ݽ؛ٜ ࢿמਸ ࠺Ү ೧ ࠇद. - DecisionTreeClassifierܳ ࢎਊ೮؊ۄب, ࢎਊೠ featureо ܰݶ ӒѤ ܲ ݽ؛ੑפ . - ఋఋץ ݈Ҋ, ܲ classification ޙઁীب ഝਊ೧ ࠁࣁਃ.