การประเมินโมเดล: โมเดลจำแนกประเภทที่มีคลาสไม่สมดุล

ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

Lisa Stuart

Data Scientist

ความไม่สมดุลของคลาส

  • ตัวแปรเป้าหมายเชิงหมวดหมู่
    • จำนวนข้อมูลแต่ละคลาสใกล้เคียงกัน
    • ความต่างมาก --> ผลลัพธ์คลาดเคลื่อน

คลาสไม่สมดุลและสมดุล

ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

Confusion matrix

Confusion matrix

1 https://scaryscientist.blogspot.com/2016/03/confusion-matrix.html
ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

เมตริกประสิทธิภาพ

เมตริกประสิทธิภาพ

1 https://scaryscientist.blogspot.com/2016/03/confusion-matrix.html
ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

เมตริกจาก matrix

เมตริกประสิทธิภาพ

1 https://scaryscientist.blogspot.com/2016/03/confusion-matrix.html
ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

เทคนิค Resampling

  • Oversample คลาสส่วนน้อย
  • Undersample คลาสส่วนใหญ่
  • หมายเหตุ: แบ่งชุด test และ train ก่อน re-sampling เสมอ!

เทคนิค Resampling

1 https://www.svds.com/learning-imbalanced-classes/
ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

ฟังก์ชัน

ฟังก์ชัน ค่าที่คืนกลับ
sklearn.linear_model.LogisticRegression logistic regression
sklearn.metrics.confusion_matrix(y_test,y_pred) confusion matrix
sklearn.metrics.precision_score(y_test,y_pred) precision
sklearn.metrics.recall_score(y_test,y_pred) recall
sklearn.metrics.f1_score(y_test,y_pred) f1 score
sklearn.utils.resample(deny, n_samples=len(approve)) resamples
ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

มาฝึกกันเถอะ!

ฝึกตอบคำถามสัมภาษณ์ Machine Learning ด้วย Python

Preparing Video For Download...