Skip to main content

An efficient aggregation based symbolic representation

Project description

fABBA

An efficient aggregation based symbolic representation for temporal data

License

fABBA is a fast and accurate symbolic representation methods, which allows for data compression and mining. By replacing the k-means clustering used in ABBA with a sorting-based aggregation technique, fABBA thereby avoid repeated within-cluster-sum-of-squares computations, and the computational complexity is significantly reduced. Also, in contrast to the ABBA, fABBA does not require the number of time series symbols to be specified in advance while achieves competing performance against ABBA and other symbolic methods.

Install

To install the current release

pip install fABBA

Apply series compression

>>> import numpy as np
>>> from fABBA.symbolic_representation import fabba_model
>>> np.random.seed(1)
>>> N = 100
>>> ts = np.random.rand(N)
>>> fabba = fabba_model(tol=0.1, alpha=0.5, sorting='lexi', scl=1, verbose=1, max_len=np.inf, string_form=True)
>>> print(fabba)
fABBA({'_alpha': 0.5, '_sorting': 'lexi', '_tol': 0.1, '_scl': 1, '_verbose': 1, '_max_len': inf, '_string_form': True, '_n_jobs': 1})

>>> string = fabba.fit_transform(ts)
>>> print(string)
&"+"!'$#(",!")*$")%!"$-!%&#!#$#(#$."&!%!#/%!#!*0'!1!

>>> inverse_ts = fabba.inverse_transform(symbolic_tsf, ts[0]) # reconstructed time series

Apply adaptively polygonal chian approximation

>>> from fABBA.chainApproximation import compress
>>> from fABBA.chainApproximation import inverse_compress
>>> np.random.seed(1)
>>> N = 100
>>> ts = np.random.rand(N)
>>> pieces = compress(ts, tol=0.1)
>>> inverse_ts = inverse_compress(pieces, ts[0])

Apply aggregated digitization

>>> from fABBA.digitization import digitize
>>> from fABBA.digitization import inverse_digitize
>>> string, parameters = digitize(pieces, alpha=0.1, sorting='2-norm', scl=1) # pieces from aforementioned compression
>>> print(''.join(string))
,"-#!.%&/#0'"12(#34$&%5!67)$*(+8*9:";!<'+=>!)$?@A!B!

>>> inverse_pieces = inverse_digitize(string, parameters)
>>> inverse_ts = inverse_compress(inverse_pieces, ts[0])

Image compression

>>> from fABBA.load_datasets import load_images
>>> from fABBA.symbolic_representation import image_compress
>>> from fABBA.symbolic_representation import image_decompress
>>> from fABBA.symbolic_representation import fabba_model
>>> from cv2 import resize
>>> img_samples = load_images(shape=(100,100)) # load fABBA image test samples
>>> img = resize(img_samples[0], (100, 100)) # select the first image for test
>>> fabba = fabba_model(tol=0.1, alpha=0.01, sorting='2-norm', scl=1, verbose=1, max_len=np.inf, string_form=True)
>>> strings = image_compress(fabba, img)
>>> inverse_img = image_decompress(fabba, strings)

Authors

Stefan Guettel stefan.guettel@manchester.ac.uk

Xinye Chen xinye.chen@manchester.ac.uk

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fABBA-0.1.8.tar.gz (316.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fABBA-0.1.8-cp38-cp38-win_amd64.whl (213.4 kB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file fABBA-0.1.8.tar.gz.

File metadata

  • Download URL: fABBA-0.1.8.tar.gz
  • Upload date:
  • Size: 316.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for fABBA-0.1.8.tar.gz
Algorithm Hash digest
SHA256 10b1eb6a41799ffbaf00214b4378f57f3349b02858280c1e363e1374ae305db2
MD5 23430bfa2cafb1dab8abad7cb5742eb2
BLAKE2b-256 6a4c30b0fa06b207d554d850f6cc38239645784116afbbe587ece2a552be0824

See more details on using hashes here.

File details

Details for the file fABBA-0.1.8-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fABBA-0.1.8-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 213.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for fABBA-0.1.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f6c39c3aabd44453b25b056dfbfb667e2ffcd080afeb810eff49f505e7585a6a
MD5 61cb1e853ab7147a68732e6958e27d65
BLAKE2b-256 2b679af7a308b80901bb76135cfb273a340c44c2bd11eed8a04b8c543b9c82ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page