October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to split the churn dataset into training and testing datasets:
> library(rpart)
> churn.rp = rpart(churn ~ ., data=trainset)
> churn.rp
> printcp(churn.rp) Output Classification tree: rpart(formula = churn ~ ., data = trainset) Variables actually used in tree construction: [1] international_plan number_customer_service_calls [3] total_day_minutes total_eve_minutes [5] total_intl_calls total_intl_minutes [7] voice_mail_plan Root node error: 342/2315 = 0.14773 ...
Read now
Unlock full access