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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.