How to forecaste of sensor values by using NUPIC?


#1

Dear All,
i am working on NUPIC.i am having minute data.
i want to forecast 30 future points. which parameters
should i change in Hot Gym Prediction Example to get those values ?
Thanks,
kr_varma


#2

Hi @rakeshvarmak, I think this thread called ‘predicting multiple steps into the future’ will help you:

It seems that within in the model params file the ‘clParams’ dict needs to be changed. The ‘steps’ list should include all points into the future you want to predict, so if you want the next 30 you should list all values 1 through 30 (as I start to do below)

‘clParams’: {

‘steps’: ‘1,2,3,4,5,6’,

},

It also seems that you’ll have to do add to the run.py file. In the demo the prediction is extracted and then written to the output with these lines:

prediction = result.inferences[“multiStepBestPredictions”][1]
output.write([timestamp], [consumption], [prediction])

I believe that you’ll have to make more ‘prediction =’ lines to get and then write the multiple predictions, something like:

prediction2 = result.inferences[“multiStepBestPredictions”][2]
prediction3 = result.inferences[“multiStepBestPredictions”][3]
prediction4 = result.inferences[“multiStepBestPredictions”][4]
prediction5 = result.inferences[“multiStepBestPredictions”][5]

and then write them all:

output.write([timestamp], [consumption], [prediction],[prediction2],[prediction3],[prediction4],[prediction5])

I’d say give this a try with just a couple steps ahead, and if it works then you can expand it out to all 30 steps. Hopefully someone (such as @rhyolight ) can verify this but I’d say give it a shot and see if it works, then let us know if you run into problems.


#3

Thank you @sheiser1 for your help. According Hot Gym Example Predicting Multiple steps into the future (Predicting multiple steps into the future) .
We are swarming for only One Step. Then how should i swarm for 30 steps in Nupic ?


#4

That can be done by changing the ‘predictionSteps’ value in the swarm.py file from 1 to 30:

I would also point out that 30 steps is inherently much more difficult to get accurately that the usual 1 step of course, so I do hope you have a good amount of data and that there are some pretty clear patterns, which I think would be needed for this to work well. In case it doesn’t I might try reducing the time granularity, for example if you’re in 1-hour timesteps then it would take 30 steps to get to 30 hours, but if you go down to 6-hour timesteps then you could get to 30 hours ahead in just 5 timesteps. Just something to consider if your results are what you hoped, though give that a shot and let us know how it works out.