Getting my data to hierarchy_network_demo.py

Hi All,

So I’m trying to run my data through nupic as is done in this ‘hierarchy_network_demo.py’ example using the Network API. The entire demo file is below for reference, but I’m specifically wondering about this line where the data file to be pulled in is identified:

_INPUT_FILE_PATH = resource_filename(
  "nupic.datafiles", "extra/hotgym/rec-center-hourly.csv"
) 

Could I still use this ‘resource_filename()’ method to pull data right off of my hard drive? It looks like this ‘rec-center-hourly.csv’ file is being pulled in from the nupic github. Currently I am using the OPF and pulling in data files from my hard drive, could I do something similar with the Network API as in the demo, or would my data have to be kept somewhere else?

I’ve modified the ‘run.py’ file to create Temporal Anomaly models from the hotgym example in the OPF. I have for-loops within because I’m training, saving and calling in nupic models to match them with new data. I wonder if/to what extent I could bring this into the Network API and basically do the same thing with hierarchy setup. To be totally clear here is what I’m currently doing in the OPF:

Thanks again for any thoughts!!

https://pastebin.com/T5hSi3S8

Here’s the ‘hierarchy_network_demo.py’ in full:

Yes.

No, it should be on your hard drive at:

src/nupic/datafiles/extra/hotgym/rec-center-hourly.csv

You should be able to get your data from anywhere. I haven’t gotten around to fully documenting this, but there are some existing API docs around:

Although I haven’t tried it, you should be able to implement a streaming interface to get your data however you need to get it.

The OPF uses the Network API. Anything you can do with the OPF, you can do with the Network API (plus lots more).