freedelta's picture

I bought your book I few days ago (even if I had found an illegal copy somewhere) I wanted to pay for it because it is very clearly written and for programmers, it helps me a lot as I am a newbee in NN and I have a lot to learn yet.

I have a question concerning the prediction chapters, as this classes prove that a neural network can predict, but I see no real forecasting sample because always input data is needed.
To put is simply: in the SineWave sample prediction data is shown up to the 500 record, but how can it be done if I wanted to predict 500+1 record? When there are no more input?
Considering that the predict output is always based upon an existing (present) input,

I would really appreciate some help with this,

Thank you

jeffheaton's picture

Thanks for buying the book, even with pirate temptations. So far that has not been a major issue, at least that I am aware of. I really want to keep books DRM free, I know there will always be some people who try to circumvent things.

Okay, the numbers between 1-500 records are used just to predict. So say we are using a prediction window of 20. The we use records 1-20 to train to predict record 21. Then we use records 2-21 to predict record 22, and so on. Eventually, we run out of data. Then we must use records 480-500 to predict record 501. At this point we are still using 20 known records. But, we can also use records 481 to 501 to predict record 502. Record 501 was part of what we based the prediction on. Where do we get 501? We got it from the previous prediction. So you sort of slowly move out of the "known range" using some of the predictions to continue predicting.

The Encog Silverlight demo shows this in action.

http://www.heatonresearch.com/encog/benchmark.html

Click predict sunspots. You will see the sunspot wave. Which is sort of a very short-frequency sine wave with varying amplitudes. Notice the blue line tries to predict it at first and fails. Its an untrained network. Click the training buttons and the blue line moves more in line with what is before it. At the beginning of the blue line the black line is partly used to help predict. But as time progresses, only previous predictions are being used. And you get a somewhat accurate sunspot prediction.

freedelta's picture

Thanks for taking the time to answer, and I've checked the Encog Silverlight demo.
I know that predicting is a huge subject and I am looking for good material, something like the things you write, because books and papers filled with formulaes and calculus but no implementation samples are kind of far or hard to adapt to practical cases, and I prefer books from people who coded things bared knuckled like I do.

SeemaSingh's picture

That does seem to be a popular point... and sometimes a criticism of Jeff's books. He typically explains the algorithms in programming terms, rather than maths. I think the approach Jeff uses works quite well. If you just want to USE neural networks, the level of maths study you need, at least in my opinion, is not that great.

freedelta's picture

Sorry, I think I didn't explained myself well. I wanted to say that Jeff book helps me a lot since he is a programmer also and has developped all he explains, so it is to a programmer level just what I need :)
In fact it is helping me to understand neural networks.

Thanks again

jeffheaton's picture

No, I understood what you meant.

What prompted me to write the books was buying neural network books that could be 500+ pages, and no source code at all! So I wanted to write a neural network book more like a programming manual.

Glad the books are helpful.


Copyright 2005 - 2012 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright, license and trademark information.