การวนซ้ำโดยไม่ overfitting

การออกแบบ Machine Learning Workflows ด้วย Python

Dr. Chris Anagnostopoulos

Honorary Associate Professor

แผนภาพแสดง machine learning pipeline ที่สามารถปรับแต่งเพิ่มเติมหลังนำขึ้น production แล้ว

การออกแบบ Machine Learning Workflows ด้วย Python

แผนภาพเดิมที่แสดงว่าสามารถดึงข้อมูลเพิ่มเติมจาก production มาช่วยปรับแต่งโมเดลได้

การออกแบบ Machine Learning Workflows ด้วย Python

แผนภาพเดิมที่แสดงว่าผู้เชี่ยวชาญด้านโดเมนสามารถให้ข้อมูลเชิงลึกใหม่ที่อาจเปลี่ยนแปลงโมเดลได้ เช่น ฟังก์ชัน loss ใหม่

การออกแบบ Machine Learning Workflows ด้วย Python

แผนภาพเดิมที่ระบุว่าโมเดลที่นำขึ้น production คือ champion และโมเดลที่อยู่ระหว่างพัฒนาคือ challenger

การออกแบบ Machine Learning Workflows ด้วย Python

ผลลัพธ์ cross-validation

grid_search = GridSearchCV(pipe, params, cv=3, return_train_score=True)
gs = grid_search.fit(X_train, y_train)
results = pd.DataFrame(gs.cv_results_)
results[['mean_train_score', 'std_train_score', 
   'mean_test_score', 'std_test_score']]
   mean_train_score  std_train_score  mean_test_score  std_test_score
0             0.829            0.006            0.735           0.009
1             0.829            0.006            0.725           0.009
2             0.961            0.008            0.716           0.019
3             0.981            0.005            0.749           0.024
...
การออกแบบ Machine Learning Workflows ด้วย Python

ผลลัพธ์ cross-validation

   mean_train_score  std_train_score  mean_test_score  std_test_score
0             0.829            0.006            0.735           0.009
1             0.829            0.006            0.725           0.009
2             0.961            0.008            0.716           0.019
3             0.981            0.005            0.749           0.024
4             0.986            0.003            0.728           0.009
5             0.995            0.002            0.751           0.008

ข้อสังเกต:

  • คะแนน training สูงกว่าคะแนน test มาก
  • ค่าเบี่ยงเบนมาตรฐานของคะแนน test มีค่าสูง
การออกแบบ Machine Learning Workflows ด้วย Python

ชุดข้อมูลที่แบ่งเป็น training และ test โดย training ถูกแบ่งย่อยเป็นชิ้นส่วนด้วย cross-validation

การออกแบบ Machine Learning Workflows ด้วย Python

ชุดข้อมูลที่แบ่งเป็น training และ validation โดย training ถูกแบ่งย่อยเป็นชิ้นส่วนด้วย cross-validation

การออกแบบ Machine Learning Workflows ด้วย Python

การตรวจจับ overfitting

  • CV Training Score >> CV Test Score
    • overfitting ในขั้นตอน model fitting
    • ลดความซับซ้อนของ classifier
    • เพิ่มข้อมูล training
    • เพิ่มจำนวน cv
  • CV Test Score >> Validation Score
    • overfitting ในขั้นตอน model tuning
    • ลดจำนวน cv
    • ลดขนาด parameter grid

ชุดข้อมูลที่แบ่งเป็น training และ validation โดย training ถูกแบ่งย่อยเป็นชิ้นส่วนด้วย cross-validation

การออกแบบ Machine Learning Workflows ด้วย Python

ชุดข้อมูลที่แบ่งเป็น training และ validation โดย training ถูกแบ่งย่อยเป็นชิ้นส่วนด้วย cross-validation

การออกแบบ Machine Learning Workflows ด้วย Python

ชุดข้อมูลที่แบ่งเป็น training, validation และข้อมูล production โดย training ถูกแบ่งย่อยเป็นชิ้นส่วนด้วย cross-validation

การออกแบบ Machine Learning Workflows ด้วย Python

"ผู้เชี่ยวชาญ CV" ใส่ใน CV ของคุณได้เลย!

การออกแบบ Machine Learning Workflows ด้วย Python

Preparing Video For Download...