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

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 ...

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