You can download the accomodating datasets from [this](bit.ly/2YEIruj) website.
The synthetic data generator is in 'code/python/'.
To reproduce the results of WYLight, Lamp or SPuManTE, you can have a look at 'competitors/README.md'.
To reproduce our results, you first need to install Spass.

# SPASS

Required Dependencies

1. C++17 compiler, OpenMP
2. TBB

For higher precision floating points we can optionally make use of the non-standard 128 bit float type, however, for this we require GNU Quadmath, Boost.Multiprecision and g++.

On Debian or Ubuntu you can obtain these for example using 
```sh
apt install libtbb2 libtbb-dev g++ #libboost-dev 
```
On Fedora you can obtain these for example using 
```sh
dnf install tbb-devel g++ #boost-devel
```
On MacOS you can obtain these for example using Homebrew and
```sh
brew install tbb gcc libomp #boost
```

If the dependencies above are met, you can simply install the python version using
```sh
pip install .
```
and simply import the algorithms using 
```python
from spass import *
```
These functions either expect a binary numpy matrix or a sparse representation of the binary data matrix, that is $B_{ij} = 1$ implies that in row $i$ we can find the value $j$. For example $B = \begin{matrix} 0 & 1 \\ 1 & 1 \end{matrix}$ implies 
```python
data = [[0], [0, 1]]
```
For this given, we can now discover an informative pattern set

```python
alg = Spass()
alg.alpha = 0.001
alg.control = Control.FDR
alg.fit(data)
```
or we can use a numpy matrix directly, e.g.

```python
import numpy
alg.fit(numpy.random.uniform(size=(10,5)) > 0.5)
```
You can obtain e.g. patterns, frequencies or information using
```python
alg.patterns()
alg.frequencies()
alg.confidence()
```
If we have multiple datasets, i.e., classes given, you can provide these as a list as follows

```python
class_labels = [0, 1]
alg.fit(data, class_labels)
```
If you like to retrieve which patterns are characteristc for each class, you can do so using 

```python
alg.characteristic(i)
```
which provides a list of indices of patterns in ```alg.patterns()``` that are characteristic for class ```i```.

Running experiments on the data provided by us is now easy.
```python
import json
obj = json.loads(open('../datasets/dna.json', 'r').read())
alg.fit(obj['data'], obj['label'])
```
