2017-03-16 3 views
0

열차를 플롯하고 R 아래에 인쇄 된 AUC 점수 (그림 참조)를 테스트하려면 어떻게해야합니까?모델에 대한 열차 및 평가 점수 플로팅 R

나는 당신이 두 가지 색상 플롯 그런 다음 xgb에서 evaluation_log를 얻을 수 긴 형식으로 수정해야

train.gdbt <- xgb.train(params=list(objective="binary:logistic", eval_metric="auc", eta=0.5, max_depth=4, subsample=1, colsample_bytree=0.5), data=dtrain, nrounds=500, watchlist=list(eval=dtest, train=dtrain),verbose = 1) 

답변

0

아래 xgb.train 모델을 사용하고 있습니다 :

train.gdbt$evaluation_log %>% 
    gather(key=test_or_train, value=AUC, eval_auc, train_auc) %>% 
    ggplot(aes(x = iter, y = AUC, group = test_or_train, color = test_or_train)) + 
    geom_line() + 
    theme_bw() 

Test & Train AUC plot

+0

고마워! 이게 내가 원하는거야 :) – Pb89