Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

motifs.motifs throws exceptions on larger arrays #81

Closed
watsondavetrendalyze opened this issue Sep 15, 2019 · 1 comment
Closed

motifs.motifs throws exceptions on larger arrays #81

watsondavetrendalyze opened this issue Sep 15, 2019 · 1 comment

Comments

@watsondavetrendalyze
Copy link

watsondavetrendalyze commented Sep 15, 2019

I have a timeseries (pattern) of length 44,640 (1 month) and a segment (m) length of 60

Exception thrown on this array but not on subset with 10080 points (1 week)

mp = matrixProfile.stomp(pattern,m)

I am getting the following error:

OverflowError Traceback (most recent call last)
in
52 ax.legend()
53
---> 54 mtfs ,motif_d = motifs.motifs(pattern, mp, max_motifs=10)
55 print('top motifs: \n',mtfs)
56 print('top distances: \n',motif_d)

~/.local/lib/python3.6/site-packages/matrixprofile/motifs.py in motifs(ts, mp, max_motifs, radius, n_neighbors, ex_zone)
57 motif_set = set()
58 initial_motif = [min_idx]
---> 59 pair_idx = int(mp[1][min_idx])
60 if mp_current[pair_idx] != np.inf:
61 initial_motif += [pair_idx]

OverflowError: cannot convert float infinity to integer

When I run the same on 10080 points it runs fine and is very fast.

The same data runs fine with MASS2, MASS3 and Stumped over much larger time series > 1.6M rows

Attached in a ZIP file with sample data
MP Debug 1.zip

@watsondavetrendalyze watsondavetrendalyze changed the title motifs.motifs throws exceptions of large arrays motifs.motifs throws exceptions on larger arrays Sep 15, 2019
@watsondavetrendalyze
Copy link
Author

I was able to debug further and I see the matrixProfile.stomp(pattern,m) is returning some NaN values over some range in the data. I do not get this issue on other ranges nor on when using MASS2 and MASS3 on same range that gave the exception. As example the attached works without exception.

coinbase_1month_june_debugtest.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants