Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

by Ralph Winters
June 2017
Beginner to intermediate
576 pages
15h 22m
English
Packt Publishing
Content preview from Practical Predictive Analytics

Creating and verifying the new simulated variables

This section simulates the independent variables Xeducation, Xgender, Xsatisfaction, Xpurch.last.month, and Xmonthly.charges. The code uses the sample() function to generate slightly different data for each of those two data frames based upon a probability vector. Some of the generated data distributions will have only slight differences between the churners and non-churners (for example, education levels), while other variables will be generated specifically to show the differences between members who stayed and who left (tenure2, and purchases last month):

#create new vars====# set the seed for reproduceabilityset.seed(1)#set the gender and Education Vectors.ed.vector <- c("Bachelor's ...
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.
Start your free trial

You might also like

Data Superstream: Analytics Engineering

Data Superstream: Analytics Engineering

Alistair Croll, Anna Filippova, Emilie Schario, Lewis Davies, Jacob Frackson, Benn Stancil, Nick Acosta, Elizabeth Caley
R: Predictive Analysis

R: Predictive Analysis

Tony Fischetti, Eric Mayor, Rui Miguel Forte
Python: Advanced Predictive Analytics

Python: Advanced Predictive Analytics

Ashish Kumar, Joseph Babcock

Publisher Resources

ISBN: 9781785886188Supplemental Content