ShinyApp

Abraham JA
08/2020

Predicting Eruption Time

In my app, I use the faithfull dataset. This dataset have only two columns:

  • Eruptions time
  • Waiting time
head(faithful,5)
  eruptions waiting
1     3.600      79
2     1.800      54
3     3.333      74
4     2.283      62
5     4.533      85

How the prediction works?

To predict the Eruption Time, I use the Waiting Time. With the data, two models are trained, the first model is a neural net with 5 hidden neurons and the second one is a linear regression. After that, I predict some values using both models.

model1 <- nnet::nnet(eruptions ~ waiting, data = faithful, size = 5, linout = T, decay = 0.1, trace = F)
model2 <- lm(eruptions ~ waiting, data = faithful)

predict1 <- predict(model1, newdata = data.frame(waiting = 40:100))
predict2 <- predict(model2, newdata = data.frame(waiting = 40:100))

Results

To visualize the differences between both models, a plot can help a lot.

plot of chunk unnamed-chunk-3