-
Notifications
You must be signed in to change notification settings - Fork 37
Examples
Wiki ▸ Examples
A few examples are provided to familiarize you with using NuPIC in a Flink environment.
- Install Flink 1.0.x, and set FLINK_HOME to the install location.
- Start a local Flink environment.
- Browse to
http://localhost:8081/
[flink]$ bin/start-local.sh
Starting jobmanager daemon on host host1.local
Consider increasing the number of task slots in the local environment, by editing the taskmanager.numberOfTaskSlots
property in $FLINK_HOME/conf/flink-conf.yaml
.
The provided bin/run-example
script launches the example program into the local Flink environment, using flink run
.
Note that the examples are also runnable in your IDE. In that situation an embedded Flink environment is automatically used.
The Hot Gym example is based on the well-known example in NuPIC: One Hot Gym Prediction Tutorial. See also the HTM.java implementation [here] (https://github.com/numenta/htm.java-examples/tree/master/src/main/java/org/numenta/nupic/examples/napi/hotgym).
The flink-htm embodiment is at flink-htm-examples/.../hotgym/HotGym.scala.
Launch the hotgym Flink job:
[flink-htm-examples]$ bin/run-example hotgym.Demo --input file://`pwd`/data/rec-center-hourly-no-header.csv --output file:///tmp/hotgym-output.csv
Examine the output once the job completes. The output consists of four columns - datetime, Speed (actual), Speed (predicted), Anomaly Score.
[flink-htm-examples]$ cat /tmp/hotgym-output.csv
07/02/10 00:00,21.2,0.0,1.0
07/02/10 01:00,16.4,21.2,1.0
07/02/10 02:00,4.7,16.4,1.0
07/02/10 03:00,4.7,4.7,1.0
07/02/10 04:00,4.6,4.7,1.0
...
12/31/10 19:00,10.5,21.1,0.65
12/31/10 20:00,5.3,10.5,0.075
12/31/10 21:00,5.1,5.3,0.175
12/31/10 22:00,5.0,5.1,0.025
Getting Started
Using
Development