랜덤포레스트
rf.model <- randomForest(data.Y~., data=train, ntree=50, mtry = sqrt(변수개수), importance=T)
rf.model
plot(rf.model, 'I')
names(rf.model)
rf.model$importance
importance(rf.model)
order(importance(rf.model)[,MeanDecreaseAccuracy], decreasing=T)
varImpPlot(rf.model)
pre <- predict(rf.model, test[,-1], type="class")
confusionMatrix(data=pre, reference=test[,1], positive='1')
pre.roc <- prediction(as.numeric(pre), as.numeric(test[,1]))
plot(performance(pre.roc, "tpr", "fpr"))
abline(a=0, b=1, lty=2, col="black")
performance(pre.roc, "auc")@y.values[[1]]