1 / 14

הערכת טיב המודל F-Measure, Kappa, Costs, MetaCost

הערכת טיב המודל F-Measure, Kappa, Costs, MetaCost. ד"ר אבי רוזנפלד. הגדרות. False Positives / Negatives. Confusion matrix 1. Confusion matrix 2. FN. Actual. Actual. FP. Predicted. Predicted. Precision (P) = 20 / 50 = 0.4 Recall (P) = 20 / 30 = 0.666 F-measure=2*.4*.666/1.0666=.5.

alyn
Download Presentation

הערכת טיב המודל F-Measure, Kappa, Costs, MetaCost

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. הערכת טיב המודלF-Measure, Kappa, Costs, MetaCost ד"ר אבי רוזנפלד

  2. הגדרות

  3. False Positives / Negatives Confusion matrix 1 Confusion matrix 2 FN Actual Actual FP Predicted Predicted Precision (P) = 20 / 50 = 0.4 Recall (P) = 20 / 30 = 0.666 F-measure=2*.4*.666/1.0666=.5

  4. The Kappa Statistic • Kappa measures relative improvement over random prediction • Dreal/ Dperfect = A (accuracy of the real model) • Drandom / Dperfect= C (accuracy of a random model) • Kappa Statistic = (A-C) / (1-C) = (Dreal/ Dperfect – Drandom/ Dperfect ) / (1 – Drandom/ Dperfect ) Remove Dperfect from all places • (Dreal – Drandom) / (Dperfect – Drandom) • Kappa = 1 when A = 1 • Kappa  0 if prediction is no better than random guessing

  5. Aside: the Kappa statistic • Two confusion matrix for a 3-class problem: real model (left) vs random model (right) • Number of successes: sum of values in diagonal (D) • Kappa = (Dreal – Drandom) / (Dperfect – Drandom) • (140 – 82) / (200 – 82) = 0.492 • Accuracy = 140/200 = 0.70 Predicted Predicted total total Actual Actual total total

  6. The kappa statistic – how to calculate Drandom? Expected confusion matrix, E, for a random model Actual confusion matrix, C total total Actual Actual total total 100*120/200 = 60 Rationale: 100 actual values, 120/200 in the predicted class, so random is: 100*120/200

  7. Cost-Sensitive Learning • מוסיפים עלות לכל סוג של סיווג • בדרך כלל, אלגוריתמים לא מפרידים בין קטגוריות • אבל יש ה-ר-ב-ה יישומים שזה חשוב: • אבחון סרטן • אבחון סיכונים (התקפות מחשב, זיוף, וכו')

  8. Class Imbalance vs. Asymmetric Misclassification costs • Class Imbalance: one class occurs much more often than the other • Asymmetric misclassification costs: the cost of misclassifying an example from one class is much larger than the cost of misclassifying an example from the other class. • לפי הניסיון שלי: שני המוסגים בדרך כלל באים ביחד • גם הפתרונות דומות • דוגמאות: • תוריד שורות מהMAJORITY CLASS • תוסיף שורות לMINORITY CLASS • תוסיף עלות לMINORITY -- METACOST

  9. Making Classifier Balanced • Baseline Methods • Random over-sampling • Random under-sampling • Under-sampling Methods • Tomek links • Condensed Nearest Neighbor Rule • One-sided selection • CNN + Tomek links • Neighborhood Cleaning Rule • Over-sampling Methods • Smote • Combination of Over-sampling method with Under-sampling method • Smote + Tomek links • Smote + ENN

  10. איזה מצב יותר טוב??? Confusion matrix 2 Confusion matrix 1 FN FN Actual Actual FP Predicted Predicted Cost matrix Error rate: 40/150 Cost: 30x1+10x2=50 Error rate: 35/150 Cost: 15x1+20x2=55

  11. MetaCost • By wrapping a cost-minimizing procedure, “meta-learning” stage, around the classifier • תתייחס לסוג הלמידה כ"קופצה שחורה" • אפשר לשנות את הCOST ולהשפיע על התוצאות

  12. דוגמא:מתי אנשים מפעילים CRUISE CONTROL

  13. מתוך WEKAMetacostבלי תוספת עלות

  14. מתוך WEKAMetacostעם עלות

More Related