Performing Predictive Analytics using R

In the previous recipe, we talked about how to perform sentiment analytics using R. In this recipe, we are going to take a look at how to perform predictive analytics using R. Here, we will be using the IRIS flower classification data in order to predict its species based on the features. You can learn more about this at https://en.wikipedia.org/wiki/Iris_flower_data_set.

Getting ready

To perform this recipe, you should have R installed on your machine.

How to do it...

To get started, we need to install an R package called e1071:

>install.packages("e1071")

This package contains the IRIS flower dataset. So, we load the library and then load the data into it:

>library(e1071)
>data(iris)

You can check whether the data ...

Get Hadoop: Data Processing and Modelling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.