Using nnet for prediction, am i doing it right?
I'm still pretty new to R and AI / ML techniques. I would like to use a neural net for prediction, and since I'm new I would just like to see if this is how it should be done. As a test case, I'm predicting values of sin() , based on 2 previous values. For training I create a data frame with y = sin(x) , x1 = sin(x-1) , x2 = sin(x-2) , then use the formula y ~ x1 + x2 . It seems to work, but I am just wondering if this is the right way to do it, or if there is a more idiomatic way. This is the code: require(quantmod) #for Lag() requre(nnet) x <- seq(0, 20, 0.1) y <- sin(x) te <- data.frame(y,