17 July 2017

OVERVIEW

The data is from the mtcars dataset

##                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
## Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
## Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
## Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
## Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
## Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
## Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1

We will use the mpg as our Y variable and the remaining as predictors for a linear model. In future releases we will use different models with tuning parameters but for this simple project we will only use a linear model.

Explanation of the app

The purpose of this app to explore the data via a histogram. The bins of the histogrm can be changed by the user using the silder. Another purpose is to display a linear models prediction with the predicted variable on the y-axis and one of the predictor variables on the x-axis.

Prediction Results

Here are the prediction model that was built by caret.

    lm <- train(mpg ~ cyl+disp+hp+drat+wt+qsec+vs+am+gear+carb, 
                 data = train,
                 method = "lm",
                 trControl = ctrl,
                 metric="RMSE")

Prediction Results 2