Skip to content

Commit

Permalink
[BUG[ Use clone estimator in BaseDeepClusterer to fix `check_fit_up…
Browse files Browse the repository at this point in the history
…dates_state` fail (#2309)

* use clone estimator

* also fix aebigru
  • Loading branch information
hadifawaz1999 authored Nov 6, 2024
1 parent ea94570 commit b27858c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions aeon/clustering/deep_learning/_ae_bgru.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ def __init__(
self.save_last_model = save_last_model
self.best_file_name = best_file_name
self.random_state = random_state
self.estimator = estimator

super().__init__(
n_clusters=n_clusters,
clustering_algorithm=clustering_algorithm,
clustering_params=clustering_params,
estimator=estimator,
batch_size=batch_size,
last_file_name=last_file_name,
Expand Down Expand Up @@ -290,7 +291,7 @@ def _score(self, X, y=None):
return self._estimator.score(latent_space)

@classmethod
def get_test_params(cls, parameter_set="default"):
def _get_test_params(cls, parameter_set="default"):
"""Return testing parameter settings for the estimator.
Parameters
Expand Down
3 changes: 2 additions & 1 deletion aeon/clustering/deep_learning/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from abc import abstractmethod

from aeon.base._base import _clone_estimator
from aeon.clustering._k_means import TimeSeriesKMeans
from aeon.clustering.base import BaseClusterer

Expand Down Expand Up @@ -116,7 +117,7 @@ def _fit_clustering(self, X):
n_clusters=2, distance="euclidean", averaging_method="mean"
)
if self.estimator is None
else self.estimator
else _clone_estimator(self.estimator)
)

# to be removed in 1.0.0
Expand Down
2 changes: 0 additions & 2 deletions aeon/testing/testing_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
"RSASTClassifier": ["check_fit_deterministic"],
"SAST": ["check_fit_deterministic"],
"RSAST": ["check_fit_deterministic"],
"AEFCNClusterer": ["check_fit_updates_state"],
"AEResNetClusterer": ["check_fit_updates_state"],
"SFA": ["check_persistence_via_pickle", "check_fit_deterministic"],
"CollectionId": ["check_transform_inverse_transform_equivalent"],
"ScaledLogitSeriesTransformer": ["check_transform_inverse_transform_equivalent"],
Expand Down

0 comments on commit b27858c

Please sign in to comment.