Mine Frequent Representative Motifs
Reason this release was yanked:
C++ version not packaged
Project description
FRM-Miner
Frequent Representative Motif Miner (FRM-Miner): Efficiently Mining Frequent Representative Motifs in Large Collections of Time Series.
This repository contains the implementation of FRM-Miner as a Python package. By default, the C++ version is built and installed, but a pure Python implementation is provided as well.
Installation
Running pip install .
from this folder compiles and installs FRM-Miner (a C++ compiler is needed for this) with dependencies.
The C++ implementation can then be imported with from frm import Miner
, the pure Python version can be imported with from frm._frm_py.miner import Miner
.
Example
You will probably get more meaningful results than this if you use your own data (collection of univariate time series, time series do not have to be equal length).
import numpy as np
import matplotlib.pyplot as plt # Not in requirements
from frm import Miner
# Set hyperparameters
MINSUP = 0.3
SEGLEN = 5
ALPHABET = 5
K = 4
# Generate 10 random time series with 100 observations each
rng = np.random.default_rng()
data = [rng.standard_normal(100) for _ in range(10)]
# Mine frequent representative motifs
miner = Miner(MINSUP, SEGLEN, ALPHABET, k=K)
motifs = miner.mine(data)
# Plot frequent representative motifs
fig, axs = plt.subplots(ncols=K, sharey='all', layout='compressed')
for motif, ax in zip(motifs, axs):
ax.plot(motif.representative)
plt.show()
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
Built Distribution
Hashes for frm_miner-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c860876daa76cc26dddb6808ffe261e0944ce99fed6351984690fd7a61af71a7 |
|
MD5 | 34ff052fce98193054e3285ee2c807f6 |
|
BLAKE2b-256 | 9d14c48eaf6791696c57b63285e9c88b5a3911af7946980cc9c4d8aca9e0026e |