O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the churn and no churn dataframes

The code begins by simulating data for the response variable (xchurn). Remember, this variable can take on only two values, 0 and 1. Since we want these groups to behave differently, we will simulate separate data separately for each of the two groups, the churners (xchurn) and those that remained active at the end of the 12 month period (xnochurn):

#simulate churn data====setwd('C:/PracticalPredictiveAnalytics/Outputs')frame.size <- 1000xchurn <- data.frame(Churn=rep(c(1),frame.size))xnochurn <- data.frame(Churn=rep(c(0),frame.size))

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required