Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpdist throws error #95

Open
rcyost opened this issue Aug 20, 2022 · 1 comment
Open

mpdist throws error #95

rcyost opened this issue Aug 20, 2022 · 1 comment

Comments

@rcyost
Copy link

rcyost commented Aug 20, 2022

Describe the bug
When using algorithms that rely on distance like hierarchical cluster or pairwise_dist I get an error.

----> [273](file:///c%3A/Users/yosty/Desktop/Desktop_Folder/14%20-%20git/matrix_profile/fed_mp.py?line=272) mp.discover.hierarchical_clusters(ts, 52, t=1)
      [274](file:///c%3A/Users/yosty/Desktop/Desktop_Folder/14%20-%20git/matrix_profile/fed_mp.py?line=273) 

~\AppData\Roaming\Python\Python39\site-packages\matrixprofile\algorithms\hierarchical_clustering.py in hierarchical_clusters(X, window_size, t, threshold, method, depth, criterion, n_jobs)
    130         raise ValueError('criterion may only be one of: ' + opts_str)
    131 
--> 132     Y = pairwise_dist(X, window_size, threshold=threshold, n_jobs=n_jobs)
    133     Z = linkage(Y, method=method)
    134     R = inconsistent(Z, d=depth)

~\AppData\Roaming\Python\Python39\site-packages\matrixprofile\algorithms\pairwise_dist.py in pairwise_dist(X, window_size, threshold, n_jobs)
     82         for i in range(0, m - 1):
     83             for j in range(i + 1, m):
---> 84                 dm[k] = mpdist(X[i], X[j], window_size, threshold=threshold, 
     85                             n_jobs=n_jobs)
     86                 k = k + 1

~\AppData\Roaming\Python\Python39\site-packages\matrixprofile\algorithms\mpdist.py in mpdist(ts, ts_b, w, threshold, n_jobs)
     49 
     50     """
...
--> 100         raise ValueError('Unable to convert to np.ndarray!')
    101 
    102     return np.array(a)

ValueError: Unable to convert to np.ndarray!

To Reproduce
Steps to reproduce the behavior:

  1. Given an time series array ts
  2. '''mp.discover.hierarchical_clusters(ts, 52, t=1)'''

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: windows
  • Version matrixprofile 1.1.10
  • python 3.9.5

Additional context
the t parameter in hierarchical_clusters should have a range given to users

@fanyucode
Copy link

I also meet this problem.Are you slove the problem?

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

No branches or pull requests

2 participants