This is a Python project that runs NuPIC anomaly detection models against data in a River View instance. It constructs a NuPIC model using model parameters proven to work well for scalar anomalies. Then, given a river name, stream id, and field name, will pull data from River View and push each scalar data point into the newly created model.
./run.py
With no options, this script will fetch Chicago Beach Weather at Oak Street Weather Station, use the solar_radiation
field to pass into the NuPIC model, and write the output to a file.
This example is much more compelling if you plot the output. If you do not have matplotlib installed, you can always use a local spreadsheet program to plot the predictions and results. But if you have matplotlib, just run with the --plot
option to plot.
You can specify options on the command line for other rivers / streams / fields:
Options:
-h, --help show this help message and exit
-p, --plot Plot results in matplotlib instead of writing to file
(requires matplotlib).
-u URL, --url=URL Allows you to provide URL to custom River View
instance.
-r RIVER, --river=RIVER
Which River to use.
-s STREAM, --stream=STREAM
Which Stream in the River to pull data from.
-f FIELD, --field=FIELD
Which field of data within stream to build anomaly
model on.
The following will fetch data from the ERCOT System Wide Demand stream, analyzing and plotting the Demand
field.
./run.py -r ercot-demand -s system_wide_demand -f Demand --plot
While the plot and the output file contains predictions from the NuPIC model, the model parameters used to create the model were not optimized for prediction. Therefore, the predictions will very likely be inaccurate. This example program is best suited for identifying anomalies within River data streams.