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

Example – simulating if a customer contact will yield a sale

Here is an example that is based upon a business estimate that one of three customer contacts will result in a sale. Another assumption is that if a sale is made, it will result in an average of $100 each with a standard deviation of $5.

ExpectedPayoff either produces 0 revenue or a figure that hovers around $100, as specified in line 5 of the following code:

library(ggplot2) set.seed(123) CustomerAcquired.Flag <- sample(c(0,0,1), 100, replace = TRUE) Revenue <- sample(rnorm(100,100,5)) ExpectedPayoff <- CustomerAcquired.Flag*Revenue head(ExpectedPayoff) PayoffCompare = ggplot(data.frame(ExpectedPayoff), aes(x=ExpectedPayoff)) + stat_bin(binwidth=5, position="identity") PayoffCompare ...
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