Abraham JA
08/2020
In my app, I use the faithfull dataset. This dataset have only two columns:
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
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))
To visualize the differences between both models, a plot can help a lot.