Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add dummy clusterer tags #2551

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions aeon/clustering/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ class DummyClusterer(BaseClusterer):
array([0, 1, 0])
"""

_tags = {
"X_inner_type": ["np-list", "numpy3D"],
"capability:missing_values": True,
"capability:multivariate": True,
"capability:unequal_length": True,
}

def __init__(self, strategy="uniform", n_clusters=3, random_state=None):
self.strategy = strategy
self.random_state = random_state
Expand All @@ -78,8 +85,7 @@ def _fit(self, X, y=None):
self : object
Fitted estimator.
"""
n_samples = X.shape[0]

n_samples = len(X)
if self.strategy == "random":
rng = check_random_state(self.random_state)
self.labels_ = rng.randint(self.n_clusters, size=n_samples)
Expand Down Expand Up @@ -111,7 +117,7 @@ def _predict(self, X, y=None) -> np.ndarray:
labels : ndarray of shape (n_samples,)
Index of the cluster each sample belongs to.
"""
n_samples = X.shape[0]
n_samples = len(X)
if self.strategy == "random":
rng = check_random_state(self.random_state)
return rng.randint(self.n_clusters, size=n_samples)
Expand Down