Skip to content

Commit ef18e29

Browse files
[MNT] Deprecation in deep clustering module (#2380)
* deprecate * rerun tests
1 parent 09b8bb2 commit ef18e29

File tree

7 files changed

+0
-76
lines changed

7 files changed

+0
-76
lines changed

aeon/clustering/deep_learning/_ae_abgru.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class AEAttentionBiGRUClusterer(BaseDeepClusterer):
2020
2121
Parameters
2222
----------
23-
clustering_algorithm : str, default="deprecated"
24-
Use 'estimator' parameter instead.
25-
clustering_params : dict, default=None
26-
Use 'estimator' parameter instead.
2723
estimator : aeon clusterer, default=None
2824
An aeon estimator to be built using the transformed data.
2925
Defaults to aeon TimeSeriesKMeans() with euclidean distance
@@ -105,8 +101,6 @@ class AEAttentionBiGRUClusterer(BaseDeepClusterer):
105101
def __init__(
106102
self,
107103
estimator=None,
108-
clustering_algorithm="deprecated",
109-
clustering_params=None,
110104
latent_space_dim=128,
111105
n_layers_encoder=2,
112106
n_layers_decoder=2,
@@ -150,8 +144,6 @@ def __init__(
150144
self.random_state = random_state
151145

152146
super().__init__(
153-
clustering_algorithm=clustering_algorithm,
154-
clustering_params=clustering_params,
155147
estimator=estimator,
156148
batch_size=batch_size,
157149
last_file_name=last_file_name,

aeon/clustering/deep_learning/_ae_bgru.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class AEBiGRUClusterer(BaseDeepClusterer):
2020
2121
Parameters
2222
----------
23-
clustering_algorithm : str, default="deprecated"
24-
Use 'estimator' parameter instead.
25-
clustering_params : dict, default=None
26-
Use 'estimator' parameter instead.
2723
estimator : aeon clusterer, default=None
2824
An aeon estimator to be built using the transformed data.
2925
Defaults to aeon TimeSeriesKMeans() with euclidean distance
@@ -103,9 +99,7 @@ class AEBiGRUClusterer(BaseDeepClusterer):
10399

104100
def __init__(
105101
self,
106-
clustering_algorithm="deprecated",
107102
estimator=None,
108-
clustering_params=None,
109103
latent_space_dim=128,
110104
temporal_latent_space=False,
111105
n_layers=2,
@@ -149,8 +143,6 @@ def __init__(
149143
self.random_state = random_state
150144

151145
super().__init__(
152-
clustering_algorithm=clustering_algorithm,
153-
clustering_params=clustering_params,
154146
estimator=estimator,
155147
batch_size=batch_size,
156148
last_file_name=last_file_name,

aeon/clustering/deep_learning/_ae_dcnn.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class AEDCNNClusterer(BaseDeepClusterer):
1919
2020
Parameters
2121
----------
22-
clustering_algorithm : str, default="deprecated"
23-
Use 'estimator' parameter instead.
24-
clustering_params : dict, default=None
25-
Use 'estimator' parameter instead.
2622
estimator : aeon clusterer, default=None
2723
An aeon estimator to be built using the transformed data.
2824
Defaults to aeon TimeSeriesKMeans() with euclidean distance
@@ -118,8 +114,6 @@ class AEDCNNClusterer(BaseDeepClusterer):
118114
def __init__(
119115
self,
120116
estimator=None,
121-
clustering_algorithm="deprecated",
122-
clustering_params=None,
123117
latent_space_dim=128,
124118
temporal_latent_space=False,
125119
n_layers=3,
@@ -171,8 +165,6 @@ def __init__(
171165
self.random_state = random_state
172166

173167
super().__init__(
174-
clustering_params=clustering_params,
175-
clustering_algorithm=clustering_algorithm,
176168
estimator=estimator,
177169
batch_size=batch_size,
178170
last_file_name=last_file_name,

aeon/clustering/deep_learning/_ae_drnn.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ class AEDRNNClusterer(BaseDeepClusterer):
2424
2525
Parameters
2626
----------
27-
clustering_algorithm : str, default="deprecated"
28-
Please use the 'estimator' parameter.
2927
estimator : aeon clusterer, default=None
3028
An aeon estimator to be built using the transformed data.
3129
Defaults to aeon TimeSeriesKMeans() with euclidean distance
3230
and mean averaging method and n_clusters set to 2.
33-
clustering_params : dict, default=None
34-
Please use 'estimator' parameter.
3531
latent_space_dim : int, default=128
3632
Dimension of the latent space of the auto-encoder.
3733
temporal_latent_space : bool, default = False
@@ -119,8 +115,6 @@ class AEDRNNClusterer(BaseDeepClusterer):
119115
def __init__(
120116
self,
121117
estimator=None,
122-
clustering_algorithm="deprecated",
123-
clustering_params=None,
124118
latent_space_dim=128,
125119
temporal_latent_space=False,
126120
n_layers_encoder=3,
@@ -175,8 +169,6 @@ def __init__(
175169

176170
super().__init__(
177171
estimator=estimator,
178-
clustering_algorithm=clustering_algorithm,
179-
clustering_params=clustering_params,
180172
batch_size=batch_size,
181173
last_file_name=last_file_name,
182174
)

aeon/clustering/deep_learning/_ae_fcn.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ class AEFCNClusterer(BaseDeepClusterer):
2525
An aeon estimator to be built using the transformed data.
2626
Defaults to aeon TimeSeriesKMeans() with euclidean distance
2727
and mean averaging method and n_clusters set to 2.
28-
clustering_algorithm : str, default="deprecated"
29-
Please use 'estimator' parameter.
30-
clustering_params : dict, default=None
31-
Please use 'estimator' parameter.
3228
latent_space_dim : int, default=128
3329
Dimension of the latent space of the auto-encoder.
3430
temporal_latent_space : bool, default = False
@@ -127,8 +123,6 @@ class AEFCNClusterer(BaseDeepClusterer):
127123
def __init__(
128124
self,
129125
estimator=None,
130-
clustering_algorithm="deprecated",
131-
clustering_params=None,
132126
latent_space_dim=128,
133127
temporal_latent_space=False,
134128
n_layers=3,
@@ -183,8 +177,6 @@ def __init__(
183177

184178
super().__init__(
185179
estimator=estimator,
186-
clustering_algorithm=clustering_algorithm,
187-
clustering_params=clustering_params,
188180
batch_size=batch_size,
189181
last_file_name=last_file_name,
190182
)

aeon/clustering/deep_learning/_ae_resnet.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ class AEResNetClusterer(BaseDeepClusterer):
2828
An aeon estimator to be built using the transformed data.
2929
Defaults to aeon TimeSeriesKMeans() with euclidean distance
3030
and mean averaging method and n_clusters set to 2.
31-
clustering_algorithm : str, default="deprecated"
32-
Please use 'estimator' parameter.
33-
clustering_params : dict, default=None
34-
Please use 'estimator' parameter.
3531
latent_space_dim : int, default=128
3632
Dimension of the latent space of the auto-encoder.
3733
temporal_latent_space : bool, default = False
@@ -137,8 +133,6 @@ def __init__(
137133
self,
138134
estimator=None,
139135
n_residual_blocks=3,
140-
clustering_algorithm="deprecated",
141-
clustering_params=None,
142136
n_conv_per_residual_block=3,
143137
n_filters=None,
144138
kernel_size=None,
@@ -193,8 +187,6 @@ def __init__(
193187

194188
super().__init__(
195189
estimator=estimator,
196-
clustering_algorithm=clustering_algorithm,
197-
clustering_params=clustering_params,
198190
batch_size=batch_size,
199191
last_file_name=last_file_name,
200192
)

aeon/clustering/deep_learning/base.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ class BaseDeepClusterer(BaseClusterer):
1515
1616
Parameters
1717
----------
18-
n_clusters : int, default=None
19-
Please use 'estimator' parameter.
2018
estimator : aeon clusterer, default=None
2119
An aeon estimator to be built using the transformed data.
2220
Defaults to aeon TimeSeriesKMeans() with euclidean distance
2321
and mean averaging method and n_clusters set to 2.
24-
clustering_algorithm : str, default="deprecated"
25-
Please use 'estimator' parameter.
26-
clustering_params : dict, default=None
27-
Please use 'estimator' parameter.
2822
batch_size : int, default = 40
2923
training batch size for the model
3024
last_file_name : str, default = "last_model"
@@ -46,14 +40,10 @@ class BaseDeepClusterer(BaseClusterer):
4640
def __init__(
4741
self,
4842
estimator=None,
49-
clustering_algorithm="deprecated",
50-
clustering_params=None,
5143
batch_size=32,
5244
last_file_name="last_model",
5345
):
5446
self.estimator = estimator
55-
self.clustering_algorithm = clustering_algorithm
56-
self.clustering_params = clustering_params
5747
self.batch_size = batch_size
5848
self.last_file_name = last_file_name
5949

@@ -110,8 +100,6 @@ def _fit_clustering(self, X):
110100
X : np.ndarray, shape=(n_cases, n_timepoints, n_channels)
111101
The input time series.
112102
"""
113-
import warnings
114-
115103
self._estimator = (
116104
TimeSeriesKMeans(
117105
n_clusters=2, distance="euclidean", averaging_method="mean"
@@ -120,22 +108,6 @@ def _fit_clustering(self, X):
120108
else _clone_estimator(self.estimator)
121109
)
122110

123-
# to be removed in 1.0.0
124-
if (
125-
self.clustering_algorithm != "deprecated"
126-
or self.clustering_params is not None
127-
):
128-
warnings.warn(
129-
"The 'n_clusters' 'clustering_algorithm' and "
130-
"'clustering_params' parameters "
131-
"will be removed in v1.0.0. "
132-
"Their usage will not have an effect, "
133-
"please use the new 'estimator' parameter to directly "
134-
"give an aeon clusterer as input.",
135-
FutureWarning,
136-
stacklevel=2,
137-
)
138-
139111
latent_space = self.model_.layers[1].predict(X)
140112
self._estimator.fit(X=latent_space)
141113
if hasattr(self._estimator, "labels_"):

0 commit comments

Comments
 (0)