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
2k
Other Decks in Technology
See All in Technology
TinyGoを使ったVSCode拡張機能実装
askua
2
210
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
420
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
280
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
380
Can We Measure Developer Productivity?
ewolff
1
120
QAEチームが辿った3年 ボクらが改善業務にスクラムを選んだワケ / 20241108_cloudsign_ques23
bengo4com
0
1.3k
TypeScript、上達の瞬間
sadnessojisan
41
11k
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
460
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
650
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.7k
私はこうやってマインドマップでテストすることを出す!
mineo_matsuya
0
320
Featured
See All Featured
RailsConf 2023
tenderlove
29
900
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Writing Fast Ruby
sferik
627
61k
Fireside Chat
paigeccino
33
3k
A better future with KSS
kneath
238
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.8k
A designer walks into a library…
pauljervisheath
202
24k
Typedesign – Prime Four
hannesfritz
40
2.4k
Bash Introduction
62gerente
608
210k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
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 ޙઁীب ഝਊ೧ ࠁࣁਃ.