Predict Species by Sepal and Petal vars Length and Width

Rutger Lakin
June 7th, 2016

Introduction

For this project, the species is predicted using both length and width of each sepal and petal class. The random forest method is used for classification purposes.

Training

First, the model is trained using random forest

data(iris)
library(caret)
library(rattle)

x <- randomForest(Species ~ ., data=iris)

Model accuracy

The accuracy is pretty high of 100%, as seen in the confusion matrix below.

      Accuracy          Kappa  AccuracyLower  AccuracyUpper   AccuracyNull 
  1.000000e+00   1.000000e+00   9.757074e-01   1.000000e+00   3.333333e-01 
AccuracyPValue  McnemarPValue 
  2.702787e-72            NaN 

Interface

The interface constists of:

  • Sidebar with adjustable sliders for:
    • Sepal.Length
    • Sepal.Width
    • Petal.Length
    • Petal.Width
  • Main panel
    • Prediction outcome species

Conclusion

The data product can succesfully be used to classify the species using both length and width predictors of each variable sepal and petal.