So sánh mô hình

Machine Learning với caret trong R

Zach Mayer

Data Scientist at DataRobot and co-author of caret

So sánh mô hình

  • Đảm bảo cùng được fit trên một dữ liệu!
  • Tiêu chí chọn
    • AUC trung bình cao nhất
    • Độ lệch chuẩn AUC thấp nhất
  • Hàm resamples() rất hữu ích
Machine Learning với caret trong R

Ví dụ: resamples() trên dữ liệu 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 với caret trong R

Tóm tắt kết quả

# 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 với caret trong R

Cùng thực hành nào!

Machine Learning với caret trong R

Preparing Video For Download...