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

K-shape with specified initial condition runs the same initial condition until max attempts = 10 #524

Open
r-millington opened this issue Aug 27, 2024 · 0 comments · May be fixed by #525
Open
Labels

Comments

@r-millington
Copy link

Within clustering.kshape.fit() - lines 194-247 in tslearn/clustering/kshape version 0.6.3.

This issue occurs when an initial condition is specified in k-shape, rather than using random initialisation. If the initial condition supplied results in the EmptyClusterError being triggered ("Resumed because of empty cluster"), the model is fitted again with the same initial condition until max attempts = 10 with the same initial condition. As this initial condition is not random, the same result is achieved each time. This means the code is unnecessarily slow. Max_attempts cannot be controlled externally (line 207).

While I have code to reproduce the error, the dataset is too large to share here.

Instead of fitting the model until max_attempts = 10, max_attempts should be set to 1 when an initial condition is provided.

OS: ubuntu, tslearn version 0.5.2

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