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

Cluster centers equal to 0 #1

Closed
wfphyl opened this issue Jan 25, 2017 · 1 comment
Closed

Cluster centers equal to 0 #1

wfphyl opened this issue Jan 25, 2017 · 1 comment

Comments

@wfphyl
Copy link

wfphyl commented Jan 25, 2017

Hello Mic92,

I was trying to run your code, however the results of clusters are sometimes has 0 centers.
When the cluster_num = 2, it is fine. However, when the cluster_num = 4, it has two 0 centroid.

time_series = [[1,2,3,4], [0,1,2,3], [0,1,2,3], [1,2,2,3],[2,2,2,2],[9,9,8,7],[2,2,1,1]]

cluster_num =4
clusters = _kshape(zscore(time_series), cluster_num)
clusters
(array([1, 1, 1, 1, 2, 2, 2]), array([[ 0. , 0. , 0. , 0. ],
[-1.2222319 , -0.35269008, 0.52140717, 1.05351481],
[-0.56324856, -1.1229572 , 0.83705112, 0.84915464],
[ 0. , 0. , 0. , 0. ]]))

@Mic92
Copy link

Mic92 commented Jan 25, 2017

All your time series got assigned to the second and the third centroid. I just implemented the algorithm as it were described in the paper and the provided Matlab code. It is a property of the algorithm to leave non-assignable clusters empty. If you think this is a bug, please confirm this is a derivation from the original implementation.

@Mic92 Mic92 closed this as completed Apr 26, 2017
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