aeon icon indicating copy to clipboard operation
aeon copied to clipboard

[BUG] _check_y method in BaseSegmenter overwrites y with None

Open fchavelli opened this issue 1 year ago • 2 comments

Describe the bug

In the BaseSegmenter.fit() method, when requires_y=True, the line:

y = self._check_y(y)

causes y to become None, because _check_y() does not return y (or should not modify y).

Steps/Code to reproduce the bug

No response

Expected results

The _check_y(y) method should return y after checking it, e.g.:

def _check_y(self, y): ... return y

or be used as self._check_y(y), if no modifications are done, without affecting y.

Actual results

The _check_y(y) method overwrites y with None when called.

Versions

System: python: 3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 14:45:31) [GCC 13.3.0] executable: /home/fchavell/miniconda3/envs/aeon-env/bin/python machine: Linux-6.8.0-64-generic-x86_64-with-glibc2.35 Python dependencies: aeon: 1.2.0 pip: 25.1.1 setuptools: 80.9.0 scikit-learn: 1.6.1 numpy: 2.2.6 numba: 0.61.2 scipy: 1.15.3 pandas: 2.3.1

fchavelli avatar Jul 27 '25 06:07 fchavelli

thanks for this, great spot, looks like a bug to me, I think the change to

self._check_y(y)

is best, we would welcome a PR to fix this

TonyBagnall avatar Jul 28 '25 11:07 TonyBagnall

@fchavelli fixed now, will close this, feel free to reopen if there are still problems, thanks for the spot

TonyBagnall avatar Jul 30 '25 07:07 TonyBagnall