Skip to content

Commit d1d1ae5

Browse files
[ENH] Add dummy clusterer tags (#2551)
* dummy clusterer tags * len
1 parent 8b8783c commit d1d1ae5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

aeon/clustering/dummy.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ class DummyClusterer(BaseClusterer):
5454
array([0, 1, 0])
5555
"""
5656

57+
_tags = {
58+
"X_inner_type": ["np-list", "numpy3D"],
59+
"capability:missing_values": True,
60+
"capability:multivariate": True,
61+
"capability:unequal_length": True,
62+
}
63+
5764
def __init__(self, strategy="uniform", n_clusters=3, random_state=None):
5865
self.strategy = strategy
5966
self.random_state = random_state
@@ -78,8 +85,7 @@ def _fit(self, X, y=None):
7885
self : object
7986
Fitted estimator.
8087
"""
81-
n_samples = X.shape[0]
82-
88+
n_samples = len(X)
8389
if self.strategy == "random":
8490
rng = check_random_state(self.random_state)
8591
self.labels_ = rng.randint(self.n_clusters, size=n_samples)
@@ -111,7 +117,7 @@ def _predict(self, X, y=None) -> np.ndarray:
111117
labels : ndarray of shape (n_samples,)
112118
Index of the cluster each sample belongs to.
113119
"""
114-
n_samples = X.shape[0]
120+
n_samples = len(X)
115121
if self.strategy == "random":
116122
rng = check_random_state(self.random_state)
117123
return rng.randint(self.n_clusters, size=n_samples)

0 commit comments

Comments
 (0)