Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cross Validation False Negatives / Negatives

Similar presentations


Presentation on theme: "Cross Validation False Negatives / Negatives"— Presentation transcript:

1 Cross Validation False Negatives / Negatives
ד"ר אבי רוזנפלד

2 מוטיבציה– מה רואים פה??? Correctly Classified Instances % Incorrectly Classified Instances % === Detailed Accuracy By Class === TP Rate FP Rate Precision Recall F-Measure ROC Area Class mammal bird reptile fish amphibian insect invertebrate === Confusion Matrix === a b c d e f g <-- classified as | a = mammal | b = bird | c = reptile | d = fish | e = amphibian | f = insect | g = invertebrate

3 הגדרות – נניח שיש 2 קטגוריות (P,N)
נוסחה משמעות מדד TP / (TP + FP) בכמה אחוזים דייקתי בקטגוריה מסוימת (מתוך אלו שאמרתי הם בקטגוריה) Precision TP / (TP + FN) בכמה אחוזים דייקתי בכלל במופעים בקטגוריה Recall (TP + TN) / (הכול) הדיוק הכללי Accuracy TP / P Recall(P) True Positive Rate (כמה מצאתי בצד החיובי) Sensitivity Also TPR (True Positive Rate) TN / N Recall(N) True Negative Rate (כמה מצאתי בצד השלילי) Specificity FP / (TN + FP) 1 – Recall (N) FP = False Positive Rate = 1 - Specificity

4 Confusion Matrix פה עם 2 קטגוריות
Machine Learning methods usually minimize FP+FN TPR (True Positive Rate): TP / (TP + FN) = Recall(Positive) FPR (False Positive Rate): FP / (TN + FP) = 1 – Recall(Negative) Predicted class Yes No Actual class TP: True positive FN: False negative FP: False positive TN: True negative

5 False Positives / Negatives
איך אני מסווג Confusion matrix 1 Confusion matrix 2 P N 20 10 30 90 P N 10 20 15 105 FN Actual Actual FP Predicted Predicted Precision (P) = 20 / 50 Recall (P) = 20 / 30 FP = False Positive = Type 1 Error (False Alarm) FN = False Negative = Type 2 Error (Miss) מה הRECALL וPRECISION פה בצד של P? בצד של N?

6 Example Precision (A) = 50% (500/1000) Recall (A) = 83% (500/600)
Predicted Label Positive (A) Negative (B) Known Label 500 100 10,000 Precision (A) = 50% (500/1000) Recall (A) = 83% (500/600) Accuracy = 95% (10500/11100) Sensitivity = 83% Specificity = Recall (B) = 10,000/10,500

7 הגדרות נוסחה משמעות מדד TP / (TP + FP)
בכמה אחוזים דייקתי בקטגוריה מסוימת (מתוך אלו שאמרתי הם בקטגוריה) Precision TP / (TP + FN) בכמה אחוזים דייקתי בכלל במופעים בקטגוריה Recall 2*precision*recall/ precision+recall Harmonic mean of precision and recall F-Measure (TP + TN) / (הכול) הדיוק הכללי Accuracy

8 False Positives / Negatives
Confusion matrix 1 Confusion matrix 2 P N 20 10 30 90 P N 10 20 15 105 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

9 דוגמא עם כמה קטגוריות 27 animals — 8 cats, 6 dogs, and 13 rabbits
Confusion Matrix: Predicted class Actual class Cat Dog Rabbit Cat Dog Rabbit בקטגוריית Cat יש 3 False Negatives (שהם מסויגים ככלבים), ועוד 2 False Positives של כלבים המסווגים כמו כחתולים. בקטגוריית Dog יש 3 False Negatives (2 חתולים וארנבת), ועוד 5 False Positives (3 חתולים ו2 ארנבות). Recall (Dog) = 3/6, Precision(Dog) = 3/8 What are the Recall and Precision for the other categories?

10 דוגמא פשוטה מWEKA === Summary === Correctly Classified Instances % Incorrectly Classified Instances % === Detailed Accuracy By Class === Precision Recall === Confusion Matrix === a b <-- classified as | a = FALSE -> Precision (A) = 320/582), Recall = 320/ | b = TRUE -> Precision (B) = Recall (B) = 0 שימו לב! זה חוק של ZERO בWEKA (לסווג הכול לפי הרוב) שנראה בתרגיל

11 דוגמא נוספת (מהחיות – (zoo.arff
Correctly Classified Instances % Incorrectly Classified Instances % === Detailed Accuracy By Class === TP Rate FP Rate Precision Recall F-Measure ROC Area Class mammal bird reptile fish amphibian insect invertebrate === Confusion Matrix === a b c d e f g <-- classified as | a = mammal | b = bird | c = reptile | d = fish | e = amphibian | f = insect | g = invertebrate Recall (Invertebrate) = 8/10 = 0.8, Precision = 8/11 = תרגיל: לחשב את TP Rate, FP Rate, Precision, Recall, F-Measure לכל הקטגוריות.


Download ppt "Cross Validation False Negatives / Negatives"

Similar presentations


Ads by Google