May 2019
Intermediate to advanced
664 pages
15h 41m
English
To begin, load the essential libraries and register the number of cores for parallel processing:
library(doMC) registerDoMC(cores = 4) library(caret) #setting the random seed for replication set.seed(1234) # setting the working directory where the data is located setwd("~/Desktop/chapter 15") # reading the data mydata <- read.csv("WA_Fn-UseC_-HR-Employee-Attrition.csv") #removing the non-discriminatory features identified during EDA mydata$EmployeeNumber=mydata$Over18=mydata$EmployeeCount=mydata$StandardHours = NULL #setting up cross-validation cvcontrol <- trainControl(method="repeatedcv", repeats=10, number = 10, allowParallel=TRUE) # model creation with treebag , observe ...