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

[ENH] add new test parameter sets for TimeSeriesKMeansTslearn #6195

Merged
merged 3 commits into from Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 12 additions & 18 deletions sktime/clustering/k_means/_k_means_tslearn.py
Expand Up @@ -177,22 +177,17 @@ def get_test_params(cls, parameter_set="default"):
instance.
``create_test_instance`` uses the first (or only) dictionary in ``params``
"""
# commented since k-means++ does not properly work
# errors out with
# TypeError:
# _kmeans_plusplus() missing 1 required positional argument: 'sample_weight'
#
# params1 = {
# "n_clusters": 3,
# "max_iter": 3,
# "tol": 0.001,
# "n_init": 2,
# "metric": "euclidean",
# "max_iter_barycenter": 7,
# "verbose": 0,
# "random_state": 42,
# "init": "k-means++",
# }
params1 = {
"n_clusters": 3,
"max_iter": 3,
"tol": 0.001,
"n_init": 2,
"metric": "euclidean",
"max_iter_barycenter": 7,
"verbose": 0,
"random_state": 42,
"init": "k-means++",
}
params2 = {
"n_clusters": 2,
"max_iter": 5,
Expand All @@ -204,8 +199,7 @@ def get_test_params(cls, parameter_set="default"):
"random_state": None,
"init": "random",
}
# return [params1, params2]
return [params2]
return [params1, params2]

def _score(self, X, y=None) -> float:
return np.abs(self.inertia_)