Book Image

Learning Predictive Analytics with R

By : Eric Mayor
Book Image

Learning Predictive Analytics with R

By: Eric Mayor

Overview of this book

This book is packed with easy-to-follow guidelines that explain the workings of the many key data mining tools of R, which are used to discover knowledge from your data. You will learn how to perform key predictive analytics tasks using R, such as train and test predictive models for classification and regression tasks, score new data sets and so on. All chapters will guide you in acquiring the skills in a practical way. Most chapters also include a theoretical introduction that will sharpen your understanding of the subject matter and invite you to go further. The book familiarizes you with the most common data mining tools of R, such as k-means, hierarchical regression, linear regression, association rules, principal component analysis, multilevel modeling, k-NN, Naïve Bayes, decision trees, and text mining. It also provides a description of visualization techniques using the basic visualization tools of R as well as lattice for visualizing patterns in data organized in groups. This book is invaluable for anyone fascinated by the data mining opportunities offered by GNU R and its packages.
Table of Contents (23 chapters)
Learning Predictive Analytics with R
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Exercises and Solutions
Index

Discovering other lattice plots


We have just discovered one type of plot in lattice as well as multipanel conditioning. Lattice is a rich package which features diverse plots. We have already encountered the multi-paneled scatterplot obtained using xyplot(). We will have a look at some more lattice multi-paneled graphs in this section: histograms, stacked bars, dotplots, as well as a customization of the scatterplot, where points are replaced by text.

Histograms

In the previous chapter, we examined the overall distribution of an attribute using the hist() function. The distribution of some measures can vary between groups, that is, it can be more or less skewed in some groups compared to others. The histogram() function in the lattice package allows for a visual inspection of this. We will examine variability in temperatures by month using the airquality dataset. This dataset has six attributes (Ozone, Solar.R, Wind, Temp, Month, and Day), of which you will find a description by typing:

?airquality...