Skip to main content

MrSQM: Fast Time Series Classification with Symbolic Representations

Project description

MrSQM: Fast Time Series Classification with Symbolic Representations

MrSQM (Multiple Representations Sequence Miner) is a time series classifier. The MrSQM method can quickly extract features from multiple symbolic representations of time series and train a linear classification model with logistic regression. The method has four variants with four different feature selection strategies:

  • MrSQM-R: Random feature selection.
  • MrSQM-RS: MrSQM-R with a follow-up Chi2 test to filter less important features.
  • MrSQM-S: Pruning the all-subsequence feature space with a Chi2 bound and selecting the optimal set of top k subsequences.
  • MrSQM-SR: Random sampling of the features from the output of MrSQM-S.

Installation

Dependencies

cython >= 0.29
numpy >= 1.18
pandas >= 1.0.3
scikit-learn >= 0.22
fftw3 (http://www.fftw.org/)

Installation using pip

pip install mrsqm

Installation from source

Download the repository:

git clone https://github.com/mlgig/mrsqm.git

Move into the code directory of the repository:

cd mrsqm/mrsqm

Build package from source using:

pip install .

Example

Load data from arff files

X_train,y_train = util.load_from_arff_to_dataframe("data/Coffee/Coffee_TRAIN.arff")
X_test,y_test = util.load_from_arff_to_dataframe("data/Coffee/Coffee_TEST.arff")

Train with MrSQM

clf = MrSQMClassifier(nsax=0, nsfa=5)
clf.fit(X_train,y_train)

Make predictions

predicted = clf.predict(X_test)

Alt

More examples can be found in the example directory, including a Jupyter Notebook with detailed steps for training, prediction and explanation. The full UEA and UCR Archive can be downloaded from http://www.timeseriesclassification.com/.

This repository provides supporting code, results and instructions for reproducing the work presented in our publication:

"Fast Time Series Classification with Random Symbolic Subsequences", Thach Le Nguyen and Georgiana Ifrim https://project.inria.fr/aaltd22/files/2022/08/AALTD22_paper_5778.pdf

"MrSQM: Fast Time Series Classification with Symbolic Representations and Efficient Sequence Mining", Thach Le Nguyen and Georgiana Ifrim https://arxiv.org/abs/2109.01036

Citation

If you use this work, please cite as:

@article{mrsqm2022,
  title={Fast Time Series Classification with Random Symbolic Subsequences},
  author={Le Nguyen, Thach and Ifrim, Georgiana},
  year={2022},
  booktitle = {AALTD},
  url = {https://project.inria.fr/aaltd22/files/2022/08/AALTD22_paper_5778.pdf},
  publisher={Springer}
}
@article{mrsqm2022-extended,
  title={MrSQM: Fast Time Series Classification with Symbolic Representations and Efficient Sequence Mining},
  author={Le Nguyen, Thach and Ifrim, Georgiana},
  year={2022},
  booktitle = {arxvi},
  url = {https://arxiv.org/abs/2109.01036},
  publisher={}
}

Project details


Download files

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

Source Distribution

mrsqm-0.0.6.tar.gz (181.8 kB view hashes)

Uploaded Source

Built Distributions

mrsqm-0.0.6-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.8 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

mrsqm-0.0.6-pp38-pypy38_pp73-macosx_10_13_x86_64.whl (1.3 MB view hashes)

Uploaded PyPy macOS 10.13+ x86-64

mrsqm-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mrsqm-0.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

mrsqm-0.0.6-cp311-cp311-macosx_10_13_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.13+ x86-64

mrsqm-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mrsqm-0.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

mrsqm-0.0.6-cp310-cp310-macosx_10_13_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.13+ x86-64

mrsqm-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

mrsqm-0.0.6-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

mrsqm-0.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

mrsqm-0.0.6-cp39-cp39-macosx_10_13_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.13+ x86-64

mrsqm-0.0.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

mrsqm-0.0.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

mrsqm-0.0.6-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (1.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

mrsqm-0.0.6-cp38-cp38-macosx_10_13_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.13+ x86-64

Supported by

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