No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 78ae7d4 Jan 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts Bump Flink to 1.4.0 Feb 12, 2018
src fix style Jan 17, 2019
tools/maven Force Scala Macros usage to generate TypeInformation Jun 9, 2017
.gitattributes [SOLMA] Initial Commit Mar 29, 2017
.gitignore [SOLMA] Initial Commit Mar 29, 2017
.travis.yml Make Flink PS available to travis Nov 10, 2017 Update with Nursey dataset Jun 21, 2018
pom.xml [PROTEUS-48] Lasso basic implementation Dec 12, 2017


Solma is a scalable online machine learning algorithms (including classification, clustering, regression, ensemble algorithms, graph oriented algorithms, linear algebra operations, and anomaly and novelty detection) implemented on top of Apache Flink using the hybrid processing capabilities.

Build Status


  • Clone proteus-engine [1] (if already cloned, execute git pull origin proteus-dev)
  • From commandline go to above directory and execute mvn clean install
  • Clone SOLMA library [2] (if already cloned, execute git pull origin master)
  • Install Flink Parameter Server (execute ./script/ )
  • Move to above directory and execute mvn clean install
  • To use SOLMA library, create Maven project (in your favorite IDE)
  • You can use sample pom file [4]. Please change project specific fields like <mainClass> to related value
  • For simple examples, please look at unit tests.
  • To generate jar with a given project, go to related directory (with command line) and execute mvn clean install
  • Use jar file under ./target/ and use [3] to exetuce jar with flink








The SAX-VSM algorithm is implemented as two independent algorithms in SOLMA: SAX and SAXDictionary. Both algorithms can be used together following the SAX-VSM implementation, or they can be used independently.

References for this algorithm can be found at:

Senin, Pavel, and Sergey Malinchik. "Sax-vsm: Interpretable time series
classification using SAX and vector space model."
2013 IEEE 13th International Conference on Data Mining (ICDM),
IEEE, 2013.


The SAX algorithm provides a method to transform a DataStream[Double] into a set of words supporting PAA transformation.

To train the SAX and use it to transform a time series use the following approach:

 // Obtain the training and evaluation datasets.
 val trainingDataSet : DataSet[Double] = env.fromCollection(...)
 val evalDataSet : DataStream[Double] = streamingEnv.fromCollection(...)

 // Define the SAX algorithm
 val sax = new SAX().setPAAFragmentSize(2).setWordSize(2)
 // Fit the SAX
 // Transform the datastream
 val transformed = sax.transform(evalDataSet)

The algorithm accepts the following parameters:

  • PAAFragmentSize: It indicates the number of elements that will be averaged during the PAA process.
  • WordSize: It determines the size of the words to be used
  • AlphabetSize: It determines the size of the alphabet in terms of number of symbols


// Dataset 1 corresponds to class 1
val dataset1 : DataSet[String] = env.fromCollection(...)
val toFit1 =, 1))
// Dataset 2 corresponds to class 2
val dataset2 : DataSet[String] = env.fromCollection(trainingData2)
val toFit2 =, 2))
// Build the SAX dictionary
val saxDictionary = new SAXDictionary()
// Fit the dictionary
// Evaluation datastream
val evalDataSet : DataStream[String] = streamingEnv.fromCollection(...)
// Determine the number of words in the window
val evalDictionary = saxDictionary.setNumberWords(3)
val predictions = evalDictionary.predict[String, SAXPrediction](evalDataSet)

The algorithm supports the following parameters:

  • NumberWords: It determines the number of words that need to appear in a window to compute the prediction.

SAX + SAXDictionary

To use both algorithms:

  1. Select a training set from the signal
  2. Use the training set to fit the SAX algorithm
  3. Transform the training set to obtain the words and use that to fit the SAXDictionary
  4. Select the evaluation stream
  5. Connect the evaluation stream to pass first through the SAX algorithm and then through the SAXDictionary to obtain the predictions.


The PROTEUS SOLMA library contains extra datasets that are used for testing purposes.

Nursey dataset

The dataset is downloaded from UCI machine learning repository: Dua, D. and Karra Taniskidou, E. (2017). UCI Machine Learning Repository []. Irvine, CA: University of California, School of Information and Computer Science. Nursery dataset has three classes. To simulate the binary classification, we use the label "recommended" (to be class 1) versus the others (to be class -1).