Building attrition prediction model with stacking

Let's build an attrition prediction model with stacking:

# loading the required libraries and registering the cpu cores for multiprocessing library(doMC) library(caret) library(caretEnsemble) registerDoMC(cores=4) # setting the working directory and loading the dataset setwd("~/Desktop/chapter 2") mydata <- read.csv("WA_Fn-UseC_-HR-Employee-Attrition.csv") # removing the non-discriminatory features from the dataset as identified in EDA step mydata$EmployeeNumber=mydata$Over18=mydata$EmployeeCount=mydata$StandardHours = NULL # setting up control paramaters for cross validation control <- trainControl(method="repeatedcv", number=10, repeats=10, savePredictions=TRUE, classProbs=TRUE) # declaring ...

Get R Machine Learning Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.