aeon
aeon copied to clipboard
[DOC] Outline that clusterers cannot be used in a pipeline
Describe the issue linked to the documentation
https://www.aeon-toolkit.org/en/stable/api_reference/auto_generated/aeon.pipeline.sklearn_to_aeon.html#sklearn-to-aeon Parameter states that it can be a sklearn clusterer "sklearn compatible estimator can be classifier, regressor, transformer, clusterer" This is invalid,the following code fails.
from sklearn.cluster import KMeans
from aeon.pipeline import sklearn_to_aeon
sklearn_to_aeon(KMeans(2))
https://www.aeon-toolkit.org/en/stable/examples/clustering/clustering.html Bespoke feature based TSCL algorithms are easily constructed with aeon transformers and sklearn clusterers in a pipeline You can't create a pipeline in aeon with clusterers, following fails
from aeon.transformations.pca import PCATransformer
from aeon.clustering import TimeSeriesKMeans
from aeon.pipeline import make_pipeline
make_pipeline(PCATransformer(2),TimeSeriesKMeans(2))
Suggest a potential alternative/fix
Point out you can't make pipeline with clusterers or give an example which uses aeon and does. I want to construct a pipeline which uses things from AEON e.g. detrender.
I'll have a look, may be missing some test coverage if these no longer work.
Should be fixed by #1533.
In the mean time, the sklearn pipeline works as expected.
from aeon.testing.utils.data_gen import make_example_3d_numpy
from aeon.transformations.pca import PCATransformer
from aeon.clustering import TimeSeriesKMeans
from sklearn.pipeline import make_pipeline
p = make_pipeline(PCATransformer(), TimeSeriesKMeans(n_clusters=2))
X, y = make_example_3d_numpy()
print(p)
p.fit(X, y)
o = p.predict(X)
print(o)
thanks @MatthewMiddlehurst !!