모델 성능 평가

R로 배우는 네트워크 데이터 기반 Predictive Analytics

María Óskarsdóttir, Ph.D.

Post-doctoral researcher

예측 수행

library(pROC)
  • 로지스틱 회귀
logPredictions <- predict(logModel, newdata = test_set, type = "response")
  • 랜덤 포레스트
rfPredictions<- predict(rfModel, newdata = test_set, type='prob')
rfPredictions
attr(,"class")
      0     1
C 0.136 0.864
"matrix" "votes"
R로 배우는 네트워크 데이터 기반 Predictive Analytics

AUC

  • 임의로 선택한 이탈 고객이 비이탈 고객보다 높은 점수를 받을 확률
  • 모델의 민감도와 특이도 간의 트레이드오프를 나타냄
  • 값의 범위:
    • 0.5: 무작위 모델
    • 1: 완벽한 모델
library(pROC)
auc(test_set$label, logPredictions)
R로 배우는 네트워크 데이터 기반 Predictive Analytics

상위 십분위수 리프트

  • 예측 모델이 임의 표본 대비 이탈 고객을 얼마나 더 잘 식별하는지를 나타냄
  • 예측 이탈 확률 상위 10% 고객 중 실제 이탈 고객의 비율을 계산
  • 리프트 값이 1보다 크면 무작위 모델보다 우수함
  • 상위 10%에서 이탈 고객이 60%이고 전체 고객 중 이탈 고객이 10%이면, 리프트는 $60/10=6$
library(lift)
TopDecileLift(test_set$label, predictions, plot=TRUE)
R로 배우는 네트워크 데이터 기반 Predictive Analytics

연습해 봅시다!

R로 배우는 네트워크 데이터 기반 Predictive Analytics

Preparing Video For Download...