I’m looking for the best way to connect nupic to REST stream and procced with predictions in real time?
Here is the scenario : the network will calculate the records one by one coming through rest API and waiting for the next record, keeping connectivity even if no data is arriving for some time.
I didn’t find the correct stream class for it. It seems that the system is working only for reading csv files or to generate data trhough a loop.
Is it possibly to do with nupic ?
HITC (HTM In the Cloud) is an example of a really simple HTTP server that runs NuPIC:
@Jonathan_Mackenzie and I created this for a project a couple years ago. It works with NuPIC 1.5.6. It won’t work with the latest NuPIC (probably?), but it is an example of doing exactly what you are asking.
It seems that again in this example ‘CLA’ model is used that is easy to run and feed with incoming data.
I’m trying to make it work with network, and I’m stucked in the point that it seems that to feed a network I can only do it through a csv file (nupic v1.0.3):
dataSource = FileRecordStream(streamID=_INPUT_FILE_PATH)
...
# Specify the dataSource as a file record stream instance
sensor.dataSource = dataSource`
I thought that “StreamReader” class might be a solution, but still it seems that model description accepts only csv file as a source of data, in my case I want it to accept only a pair of values {timestamp, value}, coming from HTTP REST.
'streams': [
{'columns': [u'*'],
'info': u'hotGym.csv',
'last_record': 4000,
'source': u'file://extra/hotgym/hotgym.csv'}. => here only file can be indicated :(
],
Maybe there is another way to feed “sensor” with data that is not coming from csv?
@rhyolight - correct that you could implement your own RecordStream subclass in order to still use the OPF. It might be easier to not use the OPF though. The docs cover the alternative interfaces:
Scott, I don’t think he’s using the OPF. He’s needs to create a sensor region that is not a FileRecordSensor as described in the doc example. So he’ll still need to implement RecordStream as far as I can tell.
As I could uderstand it was realised with Network interface. But if it can be also also achieved with other nupic interfaces, can you please recommend which one will suite better my need ?