Costs and Filters Dr. Avi Rosenfeld Department of Industrial Engineering Jerusalem College of Technology
מושגים בהרצה Minority Class Problem Underfitting Overfitting Feature Selection Correlation Feature Selection Smote Cost Based Learning Metacost 2
Under-fitting / Over-fitting Underfitting: דיוק גורע בתוך הTEST DATA בגלל שהמודל לא התאים לנתונים של הTRAINING. אולי אתה חייב יותר DATA במספר השורות (instances) אולי אתה חייב יותר DATA במספר העמודות (מאפיינים) Overfitting: דיוק גרוע בתוך הTEST DATA בגלל שהמודל בתוך הTRAINING היה יותר מדי טוב (!) היכולת של המודל לנבא מה יקרה בDATA עתידי לא טוב! הTRAINING תפס דברים לא חשובים 3
הבעיה הכללי Minority Class Problem מה עושים אם המידע לא מאוזן פתרון פשוט אבל לא הגיוני– תתעלם מה MINORITY דוגמא: אם יש לך 99% מהאנשים בלי סרטן ו1% עם סרטן מה יהיה הדיוק של ZERO? מה יהיה ה PRECISION וRECALL וכל קטגוריה? האם זה קרוב יותר ל Underfitting או Overfitting? 4
Quick Overview of Feature Selection Dr. Jaume Bacardit (now at Newcastle) Topic 2: Data Preprocessing Lecture 3: Feature and prototype selection
פתרון אפשרי ל OVERFITTING Feature Selection Transforming a dataset by removing some of its columns A1A2A3A4CA2A4C
Feature Selection Great article: An Introduction to Variable and Feature Selection (Guyon and Elisseeff, 2003) Three basic approaches: Filters, wrappers, and embedded methods בשיעור שלנו נעשה פילטר וגם WRAPPER 7 Dataset Filter Classification method
איך בוחרים מה להוריד? ENTROPY / INFOGAIN מורידים אפיינים בלי INFOGAIN מעל סף מסויים מורידים מאפיינים שקרובים אחד לשני אפשרות אחת: CFS (Correlation Feature Selection) "Good feature subsets contain features highly correlated with the classification, yet uncorrelated to each other“ רוצים מאפיינים שונים וגם טובים 8
כדי לפתור את הMINORITY, אני צריך: Cost-Sensitive Learning מוסיפים עלות לכל סוג של סיווג בדרך כלל, אלגוריתמים לא מפרידים בין קטגוריות אבל יש ה-ר-ב-ה יישומים שזה חשוב: אבחון סרטן אבחון סיכונים (התקפות מחשב, זיוף, וכו')
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 תוסיף Filter ל DATA-- SMOTE תוסיף עלות ל MINORITY -- METACOST
איזה מצב יותר טוב??? PN P2010 N3090 Predicted Actual PN P02 N10 Confusion matrix 2 Cost matrix PN P1020 N15105 Predicted Actual Confusion matrix 1 FN FP Error rate: 40/150 Cost: 30x1+10x2=50 Error rate: 35/150 Cost: 15x1+20x2=55 FN
Making Classifier Balanced with Changing the Data (Filter) 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
MetaCost By wrapping a cost-minimizing procedure, “meta- learning” stage, around the classifier תתייחס לסוג הלמידה כ " קופסה שחורה " אפשר לשנות את ה COST ולהשפיע על התוצאות
דוגמא: מתי אנשים מפעילים CRUISE CONTROL
מתוך WEKA Metacost בלי תוספת עלות
מתוך WEKA Metacost עם עלות
הכנה לקראת התרגיל... 17
AUC (Area under ROC) 18
Lift: Note top Left 19
Attribute Selection and Smote 20
MetaCost 21
בחירה בשיטת למידה וCOST 22