aeon
aeon copied to clipboard
[ENG] Allow YtoX transformer to work with X=None in transform()
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
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.
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
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
this is being deprecated along with BaseTransformer, so think we can close this issue