Machine Learning with R Cookbook - Second Edition
by AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
How it works...
In this recipe, we use the telecom churn dataset as our example data source. The dataset contains 20 variables with 3,333 observations. We would like to build a classification model to predict whether a customer will churn, which is very important to telecom company as the cost of acquiring a new customer is significantly more than retaining one.
Before building the classification model, we need to preprocess the data first. Thus, we load the churn data from the C50 package into the R session with the variable name churn. As we determined that attributes such as state, area_code, and account_length are not useful features for building the classification model, we remove these attributes.
After preprocessing the data, we split ...
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.
Read now
Unlock full access