Skip to content

Commit

Permalink
remove score from dnns
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisholder committed Nov 20, 2024
1 parent c89d854 commit 4c1e6d0
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 33 deletions.
4 changes: 1 addition & 3 deletions aeon/clustering/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions aeon/clustering/deep_learning/_ae_abgru.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions aeon/clustering/deep_learning/_ae_bgru.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions aeon/clustering/deep_learning/_ae_dcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions aeon/clustering/deep_learning/_ae_drnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions aeon/clustering/deep_learning/_ae_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4c1e6d0

Please sign in to comment.