MASS (Mueen's Algorithm for Similarity Search)
Project description
MASS (Mueen's Algorithm for Similarity Search)
MASS is the fundamental algorithm that the matrix profile algorithm is built on top of. It allows you to search a time series for a smaller series. The result is an array of distances. To find the "closest" section of a time series to yours, simply find the minimum distance(s).
mass-ts is a python 2 and 3 compatible library.
- Free software: Apache Software License 2.0
Features
- MASS - the first implementation of MASS
- MASS2 - the second implementation of MASS that is significantly faster. Typically this is the one you will use.
- MASS3 - a piecewise version of MASS2 that can be tuned to your hardware. Generally this is used to search very large time series.
Installation
pip install mass-ts
Example Usage
A dedicated repository for practical examples can be found at the mass-ts-examples repository.
import numpy as np
import mass_ts as mts
ts = np.loadtxt('ts.txt')
query = np.loadtxt('query.txt')
# mass
distances = mts.mass(ts, query)
# mass2
distances = mts.mass2(ts, query)
# mass3
distances = mts.mass3(ts, query, 256)
# find minimum distance
min_idx = np.argmin(distances)
Citations
Abdullah Mueen, Yan Zhu, Michael Yeh, Kaveh Kamgar, Krishnamurthy Viswanathan, Chetan Kumar Gupta and Eamonn Keogh (2015), The Fastest Similarity Search Algorithm for Time Series Subsequences under Euclidean Distance, URL: http://www.cs.unm.edu/~mueen/FastestSimilaritySearch.html
======= History
0.1.0 (2019-05-16)
- First release on PyPI.
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
Built Distribution
Hashes for mass_ts-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e07e021138466d9ca0ab58145ff6b54e6cc96fd15286815d2f7b69ef76ec5355 |
|
MD5 | e85e8d25e48c21cdcaea5344b05934ec |
|
BLAKE2b-256 | 4efb5875e26975260dd9b8059ad59672a0878ca4fc08feacf457291777ecbd90 |