วันศุกร์ที่ 9 พฤศจิกายน พ.ศ. 2561

Imbalanced data set

  • A problem in classification i.e. labels are discrete 
  • Binary class data set is imbalanced if  YES and NO classes (i.e., the labels of data points in the set) are not 50/50 (or 60/40) in terms of the number of data points. 
  •  A dataset is marginally imbalanced if one class is rare compared to the other class.
  • Solved by under sampling  (i.e. use all the smaller class and randomly select same number of majority class several times to make multiple data sets and then combine all classification results) to balance it this is best way for this without loosing information. If you use boosting you could alter the weights and balance data that way (https://www.researchgate.net/post/How_to_know_that_our_dataset_is_imbalance). อีกวิธีที่นิยมใช้แก้ปัญหาชื่อ SMOTE ซึ่งเป็นการสร้าง synthetic samples (i.e. oversampling) ขึ้นมา https://towardsdatascience.com/dealing-with-imbalanced-classes-in-machine-learning-d43d6fa19d2
  • สมมติให้ data set มี 2 classes Class A มีจำนวน 90 เปอร์เซ็นต์ Class B มีจำนวน 10 เปอร์เซ็นต์ ถ้าไม่แก้ปัญหา imbalance แล้วใช้วิธีแล้วใช้วิธี Random ให้ 90%  อยู่ใน A จะได้ accuracy 91% แต่ถ้าพยากรณ์ถูกหมดทั้ง A & B (อาจใช้over/undersampling ช่วย) จะได้ accuracy 100%