Skip to content

[BUG] y cannot be None in WEASELTransformerV2.fit_transform() method #3283

@johannfaouzi

Description

@johannfaouzi

Describe the bug

Because of the following line:


it is impossible to set y=None in the fit_transform() method of WEASELTransformerV2.

I know that it is possible to prevent feature selection using the corresponding argument (feature_selection="none"), but I believe that it would be useful to be able to use y=None when doing unsupervised transformation to make sure that the code does not use y under the hood.

I'm not very familiar with the remaining of the code, but I'm not sure to understand why copying the y object is necessary.

Steps/Code to reproduce the bug

from aeon.classification.dictionary_based._weasel_v2 import WEASELTransformerV2
from aeon.datasets import load_classification

X_train, y_train = load_classification("ACSF1", split="train", return_metadata=False)

tnf = WEASELTransformerV2(
    feature_selection="none", max_feature_count=1_000_000, random_state=42, n_jobs=None
)
tnf.fit_transform(X_train, None)

Expected results

No error is thrown.

Actual results

The aforementioned line raises an error.

Versions

System:
python: 3.13.11 | packaged by Anaconda, Inc. | (main, Dec 10 2025, 21:21:08) [Clang 20.1.8 ]
executable: /opt/anaconda3/envs/ekotam/bin/python
machine: macOS-26.2-arm64-arm-64bit-Mach-O
Python dependencies:
aeon: 1.3.0
pip: 25.3
setuptools: 80.9.0
scikit-learn: 1.7.2
numpy: 2.2.6
numba: 0.61.2
scipy: 1.15.3
pandas: 2.3.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingclassificationClassification package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions