Skip to Content
Advanced Machine Learning with R
book

Advanced Machine Learning with R

by Cory Lesmeister, Dr. Sunil Kumar Chinnamgari
May 2019
Intermediate to advanced
664 pages
15h 41m
English
Packt Publishing
Content preview from Advanced Machine Learning with R

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 15") 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning Using R

Machine Learning Using R

Karthik Ramasubramanian, Abhishek Singh
Machine Learning with R Cookbook - Second Edition

Machine Learning with R Cookbook - Second Edition

AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
Practical Machine Learning in R

Practical Machine Learning in R

Fred Nwanganga, Mike Chapple

Publisher Resources

ISBN: 9781838641771Supplemental Content