모델 비교

R의 caret로 배우는 Machine Learning

Zach Mayer

Data Scientist at DataRobot and co-author of caret

모델 비교

  • 동일한 데이터로 학습했는지 확인하세요!
  • 선택 기준
    • 평균 AUC 최대
    • AUC 표준편차 최소
  • resamples() 함수가 유용합니다
R의 caret로 배우는 Machine Learning

예시: churn 데이터에서 resamples()

# 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 
R의 caret로 배우는 Machine Learning

결과 요약

# 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
R의 caret로 배우는 Machine Learning

연습해 봅시다!

R의 caret로 배우는 Machine Learning

Preparing Video For Download...