aeon icon indicating copy to clipboard operation
aeon copied to clipboard

[ENG] Allow YtoX transformer to work with X=None in transform()

Open aiwalter opened this issue 2 years ago • 3 comments

from sktime.datasets import load_airline
from sktime.transformations.compose import FeatureUnion, YtoX
t = YtoX().fit(X=None, y=y)
t.transform(X=None, y=y)

This transformer should accept also X=None and just append the y to None --> basically return the y and replace the None

aiwalter avatar Mar 07 '23 13:03 aiwalter

I assume the issue here is that it gets caught in the base transformer class? Perhaps tag indicating no X is required could be included.

There could also be a no_validation tag but I'm unsure if y validation is still required here.

MatthewMiddlehurst avatar May 02 '23 16:05 MatthewMiddlehurst


from aeon.datasets import load_airline
from aeon.transformations.compose import YtoX
y = load_airline()
t = YtoX().fit(X=None, y=y)
t.transform(X=None, y=y)

  File "C:\Code\aeon\aeon\local\debug.py", line 13, in <module>
    t.transform(X=None, y=y)
  File "C:\Code\aeon\aeon\transformations\base.py", line 443, in transform
    X_inner, y_inner, metadata = self._check_X_y(X=X, y=y, return_metadata=True)
  File "C:\Code\aeon\aeon\transformations\base.py", line 772, in _check_X_y
    raise TypeError("X cannot be None, but found None")
TypeError: X cannot be None, but found None

TonyBagnall avatar Mar 30 '24 10:03 TonyBagnall

I dont think you can fix this without a big redesign, since as matthew points out, its a test in the base class. I personally dont think this is a bug, since it is in the base class contract that X cannot be none. Changed the tag from bug to enhancement

TonyBagnall avatar Mar 30 '24 10:03 TonyBagnall

this is being deprecated along with BaseTransformer, so think we can close this issue

TonyBagnall avatar Jun 27 '24 20:06 TonyBagnall