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

Generating a histogram of the distribution

Rather than simply plotting the distribution, let's plot a histogram of the distribution so that we can see what the approximate error bins will look like. In fact, let's generate two different histograms, one containing the actual counts and the other containing percentages:

par(mfrow=c(1,2)) h <- hist(x,freq=FALSE,right=FALSE,breaks=c(-.20, -.15,-.10,-.05, 0, .05, .1, .15, .20)) print(h) plot(h$mids,100*h$counts/sum(h$counts),type="h",lwd=25, lty=1, main="Probability of Errors Introduced") 

In the plots below, you can see from the histogram on the left that there are no values beyond the limits specified. In fact, since the distribution was generated with a mean=0, a good number of the test elements ...

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