October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to classify the churn data with the k-nearest neighbor algorithm:
> install.packages("class")
> library(class)
> levels(trainset$international_plan) = list("0"="no", "1"="yes")
> levels(trainset$voice_mail_plan) = list("0"="no", "1"="yes")
> levels(testset$international_plan) = list("0"="no", "1"="yes")
> levels(testset$voice_mail_plan) = list("0"="no", "1"="yes")
> churn.knn = knn(trainset[,! ...
Read now
Unlock full access