Citadel Datathon
src
contains the source code used for this challenge
report
contains the source code used for the
https://v2.overleaf.com/6183192336bcqknxjpwgmt
https://drive.google.com/drive/folders/1epKW_AnAU4EOmpiUduaFQqO1_DC5cc2s?usp=sharing
library(MASS)
# Backward selection
backward_model <- MASS::stepAIC( lm(Prob~., data = dataset1) )
# Forward selection
MASS::stepAIC( lm(Prob~1, data = dataset1),
direction = "forward",
scope=list(
upper=lm(Prob~., data = dataset1),
lower=lm(Prob~1, data = dataset1))
)
set.seed(2)
library(randomForest)
model_rf <- randomForest(Y_train ~ ., data = X_train, importance = TRUE) # Including every variable
model_rf
# Prediction on test set
# No need for cross-validation - out of the bag
prediction_rf <- predict(model_rf, X_test)
table(prediction_rf, Y_test)
result <- prediction_rf==Y_test
# Summary plots
importance(model_rf)
varImpPlot(model_rf, main = "Random Forests Classifier")
# ROC AUC
plot(roc(Y_test, as.numeric(prediction_rf=="p"), direction="<" ), print.auc=TRUE, col = 'red', lwd = 3)