การเปรียบเทียบโมเดล

Machine Learning ด้วย caret ใน R

Zach Mayer

Data Scientist at DataRobot and co-author of caret

การเปรียบเทียบโมเดล

  • ตรวจสอบให้แน่ใจว่าโมเดลถูก fit บนข้อมูลชุดเดียวกัน!
  • เกณฑ์การเลือก
    • ค่าเฉลี่ย AUC สูงสุด
    • ค่าเบี่ยงเบนมาตรฐานของ AUC ต่ำสุด
  • ฟังก์ชัน resamples() ช่วยได้
Machine Learning ด้วย caret ใน R

ตัวอย่าง: resamples() กับข้อมูล churn

# Make a list
model_list <- list(
  glmnet = model_glmnet,
  rf = model_rf
)
# Collect resamples from the CV folds
resamps <- resamples(model_list)
resamps
Call:
resamples.default(x = model_list)

Models: glmnet, rf 
Number of resamples: 5 
Performance metrics: ROC, Sens, Spec 
Time estimates for: everything, final model fit 
Machine Learning ด้วย caret ใน R

สรุปผลลัพธ์

# Summarize the results
summary(resamps)
Call:
summary.resamples(object = resamps)

Models: glmnet, rf 
Number of resamples: 5 

ROC 
         Min. 1st Qu. Median   Mean 3rd Qu.   Max. NA's
glmnet 0.7526  0.7624 0.7719 0.7686  0.7722 0.7840    0
rf     0.8984  0.9028 0.9077 0.9061  0.9093 0.9125    0
Machine Learning ด้วย caret ใน R

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

Machine Learning ด้วย caret ใน R

Preparing Video For Download...