SAX · Sequitur · RePair · linear time & space

Read the grammar hidden in your time series.

GrammarViz discretizes a signal into symbols, induces a context-free grammar over them, and turns the grammar's rare and frequent rules into variable-length anomalies and motifs — interactively, as the signal streams in.

SAX discretization of a time seriesA continuous signal is sliced by equiprobable breakpoints into alphabet bands a–d and read off as a symbol string.dcbabdbcbz-norm → PAA → symbols
Built for people and pipelines

Run it as a desktop app, a CLI, or a library

GrammarViz 3.0 is pure Java and needs Java 21 or newer. Drive the interactive Swing GUI for exploration, script the command line for batch jobs, or link the core as a dependency. The GUI follows an MVC split so the discovery engine is reusable on its own.

You can watch grammar rules form in real time as a signal is acquired.

Getting started

  1. Install Java 21 or newer; java -version prints the version you have. Older Java versions refuse to run the jar.
  2. Download grammarviz2-3.0.7-jar-with-dependencies.jar from the 3.0.7 release.
  3. Start the GUI, with up to 4 GB of memory:
    java -Xmx4g -jar grammarviz2-3.0.7-jar-with-dependencies.jar
  4. Or run the anomaly CLI on the ECG 0606 series (ecg0606_1.csv); run it without arguments to print its options:
    java -cp grammarviz2-3.0.7-jar-with-dependencies.jar net.seninp.grammarviz.GrammarVizAnomaly \
        -alg RRA -i ecg0606_1.csv -w 100 -p 5 -a 5 --strategy NONE
GrammarViz 3.0.7 main window: the ECG 0606 series with the top RRA anomaly (position 417, length 109) highlighted and the GrammarViz anomalies table
Use it

Get the library

maven central

Add the dependency

GrammarViz ships as net.seninp:grammarviz2:3.0.7 on Maven Central. Download the self-contained jar from the latest release, or build it with mvn -Psingle package in the source repository.

<dependency>
  <groupId>net.seninp</groupId>
  <artifactId>grammarviz2</artifactId>
  <version>3.0.7</version>
</dependency>
reference

Cite the work

Senin, P., Lin, J., Wang, X., Oates, T., Gandhi, S., Boedihardjo, A.P., Chen, C., Frankenstein, S. GrammarViz 3.0: Interactive Discovery of Variable-Length Time Series Patterns. ACM TKDD, 2018.

References

The work behind the tool

TKDD 2018
Senin, Lin, Wang, Oates, Gandhi, Boedihardjo, Chen, Frankenstein. DOI ↗
EDBT 2015
Senin, Lin, Wang, Oates, Gandhi, Boedihardjo, Chen, Frankenstein.
ECML/PKDD 2014
Senin, Lin, Wang, Oates, Gandhi, Boedihardjo, Chen, Frankenstein, Lerner.
SDM 2012
Yuan Li, Jessica Lin, Tim Oates.