July 29, 2017

App Summary

This app uses the iris dataset, and uses a simple decision tree model to predict plant species based on sepal length, sepal width, petal length, and petal width inputs.

Default values are set to the mean of each variable, with sliders that encompass the variable ranges in the dataset. As the sliders are moved, the model uses the new inputs to make a prediction, and lines on the graphs move to show where in the population the input values fall.

Dataset Details

Below are the first few rows of the iris dataset.

head(iris)
##   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1          5.1         3.5          1.4         0.2  setosa
## 2          4.9         3.0          1.4         0.2  setosa
## 3          4.7         3.2          1.3         0.2  setosa
## 4          4.6         3.1          1.5         0.2  setosa
## 5          5.0         3.6          1.4         0.2  setosa
## 6          5.4         3.9          1.7         0.4  setosa

Length and width Plots

As mentioned in the first slide, there are two plots, which include black lines that change when inputs change. One of the base plots can be seen here:

qplot(Sepal.Width, Petal.Width, data = iris, col = Species)

Reference Links