From 4c1e6d0c2f29aa2bdd23f806bba79ed525c8eeb8 Mon Sep 17 00:00:00 2001 From: chrisholder Date: Wed, 20 Nov 2024 11:53:44 +0100 Subject: [PATCH] remove score from dnns --- aeon/clustering/base.py | 4 +--- aeon/clustering/deep_learning/_ae_abgru.py | 6 ------ aeon/clustering/deep_learning/_ae_bgru.py | 6 ------ aeon/clustering/deep_learning/_ae_dcnn.py | 6 ------ aeon/clustering/deep_learning/_ae_drnn.py | 6 ------ aeon/clustering/deep_learning/_ae_resnet.py | 6 ------ 6 files changed, 1 insertion(+), 33 deletions(-) diff --git a/aeon/clustering/base.py b/aeon/clustering/base.py index 92989a4c2c..39f216933a 100644 --- a/aeon/clustering/base.py +++ b/aeon/clustering/base.py @@ -160,9 +160,7 @@ def _fit_predict(self, X, y=None) -> np.ndarray: Index of the cluster each time series in X belongs to. """ self.fit(X) - if hasattr(self, "labels_"): - return self.labels_ - return self.predict(X) + return self.labels_ def _predict_proba(self, X) -> np.ndarray: """Predicts labels probabilities for sequences in X. diff --git a/aeon/clustering/deep_learning/_ae_abgru.py b/aeon/clustering/deep_learning/_ae_abgru.py index 88065ddffe..3b41dbfddc 100644 --- a/aeon/clustering/deep_learning/_ae_abgru.py +++ b/aeon/clustering/deep_learning/_ae_abgru.py @@ -298,12 +298,6 @@ def _fit(self, X): return self - def _score(self, X, y=None): - # Transpose to conform to Keras input style. - X = X.transpose(0, 2, 1) - latent_space = self.model_.layers[1].predict(X) - return self._estimator.score(latent_space) - @classmethod def _get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. diff --git a/aeon/clustering/deep_learning/_ae_bgru.py b/aeon/clustering/deep_learning/_ae_bgru.py index 6e12e23e03..609eaf5d65 100644 --- a/aeon/clustering/deep_learning/_ae_bgru.py +++ b/aeon/clustering/deep_learning/_ae_bgru.py @@ -296,12 +296,6 @@ def _fit(self, X): return self - def _score(self, X, y=None): - # Transpose to conform to Keras input style. - X = X.transpose(0, 2, 1) - latent_space = self.model_.layers[1].predict(X) - return self._estimator.score(latent_space) - @classmethod def _get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. diff --git a/aeon/clustering/deep_learning/_ae_dcnn.py b/aeon/clustering/deep_learning/_ae_dcnn.py index 4a83a10eb2..d6c6b8c3d5 100644 --- a/aeon/clustering/deep_learning/_ae_dcnn.py +++ b/aeon/clustering/deep_learning/_ae_dcnn.py @@ -322,12 +322,6 @@ def _fit(self, X): return self - def _score(self, X, y=None): - # Transpose to conform to Keras input style. - X = X.transpose(0, 2, 1) - latent_space = self.model_.layers[1].predict(X) - return self._estimator.score(latent_space) - @classmethod def _get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. diff --git a/aeon/clustering/deep_learning/_ae_drnn.py b/aeon/clustering/deep_learning/_ae_drnn.py index a6551d411d..0efedfb730 100644 --- a/aeon/clustering/deep_learning/_ae_drnn.py +++ b/aeon/clustering/deep_learning/_ae_drnn.py @@ -328,12 +328,6 @@ def _fit(self, X): return self - def _score(self, X, y=None): - # Transpose to conform to Keras input style. - X = X.transpose(0, 2, 1) - latent_space = self.model_.layers[1].predict(X) - return self._estimator.score(latent_space) - @classmethod def _get_test_params(cls, parameter_set="default"): """Return testing parameter settings for the estimator. diff --git a/aeon/clustering/deep_learning/_ae_resnet.py b/aeon/clustering/deep_learning/_ae_resnet.py index 26acce6b5b..ff34143281 100644 --- a/aeon/clustering/deep_learning/_ae_resnet.py +++ b/aeon/clustering/deep_learning/_ae_resnet.py @@ -362,12 +362,6 @@ def _fit(self, X): return self - def _score(self, X, y=None): - # Transpose to conform to Keras input style. - X = X.transpose(0, 2, 1) - latent_space = self.model_.layers[1].predict(X) - return self._estimator.score(latent_space) - def _fit_multi_rec_model( self, autoencoder,