SlideShare a Scribd company logo
1 of 12
ROC Curve - 101
Bert Gollnick Gollnickdata.com
ROC Curve - 101
Introduction
Receiver Operating Characteristics (ROC)
Curve
 First developed and used during WWII
for detecting enemy objects in
battlefields
 Later used in psychology, medicine,
forecasting of natural hazards, …
 … and finally model performance
assessment
Source: https://commons.wikimedia.org/wiki/File:
Chain_Home_radar_installation_at_Poling,_Sussex,_1945._CH15173.jpg
ROC Curve - 101
From Confusion Matrix to ROC Curve
ROC Curve - 101
From Confusion Matrix to ROC Curve
ROC Curve - 101
From Confusion Matrix to ROC Curve
Predicted Class
ActualClass
Yes No
Yes
True Pos
(Hit)
False Neg
(Type I Error)
No
False Pos
(Type II Error)
True Neg
(Correct Rejection)
 Y Axis on ROC Curve
𝑇𝑃𝑅 =
𝑇𝑃
𝑇𝑃 + 𝐹𝑁
ROC Curve - 101
From Confusion Matrix to ROC Curve
Predicted Class
ActualClass
Yes No
Yes
True Pos
(Hit)
False Neg
(Type I Error)
No
False Pos
(Type II Error)
True Neg
(Correct Rejection)
 X Axis on ROC Curve
𝐹𝑃𝑅 =
𝐹𝑃
𝐹𝑃 + 𝑇𝑁
ROC Curve - 101
From Confusion Matrix to ROC Curve
Threshold TN FP FN TP FPR TPR
0.01 1318 3641 3 1550 0.73 1
0.02 1776 3183 10 1543 0.64 0.99
…
0.98 4958 1 1431 122 0 0.08
0.99 4958 1 1448 105 0 0.07
Example
ROC Curve - 101
ROC Curve
FPR [-]
TPR[-]
01
0 1
Perfect Classification
Random Guess
Better
Classifier
Worse
Classifier
ROC Curve - 101
Purpose
Source: own graph
 Different methods
can be compared
ROC Curve - 101
Model Evaluation: Area Under Curve
Source: http://blog.revolutionanalytics.com/2016/11/calculating-auc.html
Area under curve
 Maps ROC to one measure
 Purpose: compare different
models
Calculates as:
 Sum of green squares
 Half of blue squares
ROC Curve - 101
Model Evaluation: Loss Curve
 Model A: AUC = 0.6
 Model B: AUC = 0.58
 Which model should you
choose?  That depends 
 FN and FP might not value
identical
 Example: WWII detection of
enemy submarine attacks
 False Negatives (actual attack,
predicted no) more critical
than False Positive.
 For this you can add different
costs, e.g. FN-Cost = 10,
FP-Cost = 1
FPR [-]
TPR[-]
0
0 1
1
Model A
Model B
Choose this model
for high FN-cost
Choose this model
for high FP-cost
ROC Curve - 101
Model Evaluation: Loss Curve
 The images show the same model, colored with different cost-penalties.

More Related Content

What's hot

Survival analysis & Kaplan Meire
Survival analysis & Kaplan MeireSurvival analysis & Kaplan Meire
Survival analysis & Kaplan MeireDr Athar Khan
 
What does an odds ratio or relative risk mean?
What does an odds ratio or relative risk mean? What does an odds ratio or relative risk mean?
What does an odds ratio or relative risk mean? Terry Shaneyfelt
 
Sampling and sampling technique
Sampling and sampling techniqueSampling and sampling technique
Sampling and sampling techniqueMoumita Pal
 
3.5.2 selection bias
3.5.2 selection bias3.5.2 selection bias
3.5.2 selection biasA M
 
ODDS RATIO AND RELATIVE RISK EVALUATION
ODDS RATIO AND RELATIVE RISK EVALUATIONODDS RATIO AND RELATIVE RISK EVALUATION
ODDS RATIO AND RELATIVE RISK EVALUATIONKanhu Charan
 
Validity of a screening test
Validity of a screening testValidity of a screening test
Validity of a screening testdrkulrajat
 
Validity and Reliability
Validity and Reliability Validity and Reliability
Validity and Reliability Tauseef Jawaid
 
Chapter 2.2 screening test
Chapter 2.2 screening testChapter 2.2 screening test
Chapter 2.2 screening testNilesh Kucha
 
Box and whisker plots
Box and whisker plotsBox and whisker plots
Box and whisker plotsGarima Gupta
 
Case control & cohort study
Case control & cohort studyCase control & cohort study
Case control & cohort studyBhumika Bhatt
 
Measures Of Association
Measures Of AssociationMeasures Of Association
Measures Of Associationganesh kumar
 
Common measures of association in medical research handout
Common measures of association in medical research handoutCommon measures of association in medical research handout
Common measures of association in medical research handoutPat Barlow
 
Tests of diagnostic accuracy
Tests of diagnostic accuracyTests of diagnostic accuracy
Tests of diagnostic accuracySimba Takuva
 
ROC CURVE AND ANALYSIS.pptx
ROC CURVE AND ANALYSIS.pptxROC CURVE AND ANALYSIS.pptx
ROC CURVE AND ANALYSIS.pptxagniva pradhan
 
Attack rate
Attack rateAttack rate
Attack ratesonytopp
 
Logistic regression with SPSS
Logistic regression with SPSSLogistic regression with SPSS
Logistic regression with SPSSLNIPE
 
Sample size by formula
Sample size by formulaSample size by formula
Sample size by formulaMmedsc Hahm
 

What's hot (20)

Survival analysis & Kaplan Meire
Survival analysis & Kaplan MeireSurvival analysis & Kaplan Meire
Survival analysis & Kaplan Meire
 
What does an odds ratio or relative risk mean?
What does an odds ratio or relative risk mean? What does an odds ratio or relative risk mean?
What does an odds ratio or relative risk mean?
 
Sampling and sampling technique
Sampling and sampling techniqueSampling and sampling technique
Sampling and sampling technique
 
Validity and Screening Test
Validity and Screening TestValidity and Screening Test
Validity and Screening Test
 
3.5.2 selection bias
3.5.2 selection bias3.5.2 selection bias
3.5.2 selection bias
 
ODDS RATIO AND RELATIVE RISK EVALUATION
ODDS RATIO AND RELATIVE RISK EVALUATIONODDS RATIO AND RELATIVE RISK EVALUATION
ODDS RATIO AND RELATIVE RISK EVALUATION
 
Validity of a screening test
Validity of a screening testValidity of a screening test
Validity of a screening test
 
Validity and Reliability
Validity and Reliability Validity and Reliability
Validity and Reliability
 
Chapter 2.2 screening test
Chapter 2.2 screening testChapter 2.2 screening test
Chapter 2.2 screening test
 
ROC curve.pptx
ROC curve.pptxROC curve.pptx
ROC curve.pptx
 
Box and whisker plots
Box and whisker plotsBox and whisker plots
Box and whisker plots
 
Case control & cohort study
Case control & cohort studyCase control & cohort study
Case control & cohort study
 
Measures Of Association
Measures Of AssociationMeasures Of Association
Measures Of Association
 
Common measures of association in medical research handout
Common measures of association in medical research handoutCommon measures of association in medical research handout
Common measures of association in medical research handout
 
Survival analysis
Survival analysisSurvival analysis
Survival analysis
 
Tests of diagnostic accuracy
Tests of diagnostic accuracyTests of diagnostic accuracy
Tests of diagnostic accuracy
 
ROC CURVE AND ANALYSIS.pptx
ROC CURVE AND ANALYSIS.pptxROC CURVE AND ANALYSIS.pptx
ROC CURVE AND ANALYSIS.pptx
 
Attack rate
Attack rateAttack rate
Attack rate
 
Logistic regression with SPSS
Logistic regression with SPSSLogistic regression with SPSS
Logistic regression with SPSS
 
Sample size by formula
Sample size by formulaSample size by formula
Sample size by formula
 

Recently uploaded

dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...Suhani Kapoor
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknowmakika9823
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 

Recently uploaded (20)

dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 

ROC Curve 101

  • 1. ROC Curve - 101 Bert Gollnick Gollnickdata.com
  • 2. ROC Curve - 101 Introduction Receiver Operating Characteristics (ROC) Curve  First developed and used during WWII for detecting enemy objects in battlefields  Later used in psychology, medicine, forecasting of natural hazards, …  … and finally model performance assessment Source: https://commons.wikimedia.org/wiki/File: Chain_Home_radar_installation_at_Poling,_Sussex,_1945._CH15173.jpg
  • 3. ROC Curve - 101 From Confusion Matrix to ROC Curve
  • 4. ROC Curve - 101 From Confusion Matrix to ROC Curve
  • 5. ROC Curve - 101 From Confusion Matrix to ROC Curve Predicted Class ActualClass Yes No Yes True Pos (Hit) False Neg (Type I Error) No False Pos (Type II Error) True Neg (Correct Rejection)  Y Axis on ROC Curve 𝑇𝑃𝑅 = 𝑇𝑃 𝑇𝑃 + 𝐹𝑁
  • 6. ROC Curve - 101 From Confusion Matrix to ROC Curve Predicted Class ActualClass Yes No Yes True Pos (Hit) False Neg (Type I Error) No False Pos (Type II Error) True Neg (Correct Rejection)  X Axis on ROC Curve 𝐹𝑃𝑅 = 𝐹𝑃 𝐹𝑃 + 𝑇𝑁
  • 7. ROC Curve - 101 From Confusion Matrix to ROC Curve Threshold TN FP FN TP FPR TPR 0.01 1318 3641 3 1550 0.73 1 0.02 1776 3183 10 1543 0.64 0.99 … 0.98 4958 1 1431 122 0 0.08 0.99 4958 1 1448 105 0 0.07 Example
  • 8. ROC Curve - 101 ROC Curve FPR [-] TPR[-] 01 0 1 Perfect Classification Random Guess Better Classifier Worse Classifier
  • 9. ROC Curve - 101 Purpose Source: own graph  Different methods can be compared
  • 10. ROC Curve - 101 Model Evaluation: Area Under Curve Source: http://blog.revolutionanalytics.com/2016/11/calculating-auc.html Area under curve  Maps ROC to one measure  Purpose: compare different models Calculates as:  Sum of green squares  Half of blue squares
  • 11. ROC Curve - 101 Model Evaluation: Loss Curve  Model A: AUC = 0.6  Model B: AUC = 0.58  Which model should you choose?  That depends   FN and FP might not value identical  Example: WWII detection of enemy submarine attacks  False Negatives (actual attack, predicted no) more critical than False Positive.  For this you can add different costs, e.g. FN-Cost = 10, FP-Cost = 1 FPR [-] TPR[-] 0 0 1 1 Model A Model B Choose this model for high FN-cost Choose this model for high FP-cost
  • 12. ROC Curve - 101 Model Evaluation: Loss Curve  The images show the same model, colored with different cost-penalties.