October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to split the churn dataset into training and testing datasets:
> install.packages("C50")
> library(C50)
> data(churn)
> str(churnTrain)
> churnTrain = churnTrain[,! names(churnTrain) %in% c("state", "area_code", "account_length") ]
> set.seed(2)
> ind = sample(2, nrow(churnTrain), replace = TRUE, prob=c(0.7, 0.3)) > trainset = churnTrain[ind == 1,] ...Read now
Unlock full access