I am testing NUPIC and I want to predict future values. I am using a similar script as the one in Hot Gym prediction.
Currently I have 400 rows of data. I run the script and the output on the csv gives me 400 rows of data.
However, I want to receive 402 rows of data, because I want to compare NUPIC predictions with future values that I will obtain in a few hours. I want to obtain the 401/402 row from the 399/400 value (step=2). Which parameters I need to change to obtain this? What represents the “predictAheadTime” parameter on the model params file?
If you are using the Hot Gym example, I believe it predicts one step into the future. The data is fed in at hourly intervals, so this is effectively predicting one hour into the future. To change this, you can update the swarm description:
Change this to:
Now it will swarm to get the best prediction 2 hours into the future, and return to you model params tuned for that.
You will probably also need to adjust your code that extracts the prediction from the result. In particular, this line:
That’s not the issue I was mentioning on top. The prediction step I already changed and it works fine. My question is about the last predicted values of NUPIC, because I think that NUPIC doens’t give me the last two predicted values (T+1, T+2).
For example: on my understanding when I input into nupic the data value on T time it will predict the value of T+2 time if I define a step of 2, right? But on the excell I have only the prediction for the last value of my real data that was calculated on T Last-2, right?
What I want is to get the T Last+1 and the T Last+2, that should be calculated based on the last two values I input into NUPIC.
If I have 200 values of data (and a step of 2) by injecting the last value of the data I should have the 202 value ( = TLast +2). Right? Or NUPIC doens’t work like this?
By doing the change on the clParams I get 1 and 2 step values?
The script for the hot gym does shifting when it writes the value on the excel?
Because I want to get future values that I don’t know. For example, if I have avg values per hour, and the last value of my data occured at 15:00 pm if I run NUPIC with a step of 2 I want to get the value at 17:00 pm that I don’t know yet.
Also, you are going to have to adjust the nupic_output.py script to get the new prediction (for the 2nd step ahead) and deal with it (write it to your file). You’re not seeing it in your output file because the demo code was only handling one prediction.
If you want to send more than one prediction into the output, you’ll need to adjust here to send in multiple predictions to the writer:
Here to adjust the headers the writer is creating:
And here to adjust how the rows are written out to include the 2nd prediction:
We had initially tried the advice in this article in order to get our very first predictions from NuPIC, 1, 2 and 3 steps ahead, using sine wave but were stumped until receiving further encouragement from rhyolight. Just want to add to the above and explain that we (somewhat in desperation!) input 500,000 values of sine into the prediction (overkill no doubt) and were enheartened to see very accurate predictions coming from NuPIC at the tail end.
Thank you, Jose, for posting this question and many thanks to rhyolight for the push in the right direction!