repeated calls to fit will fail if the number of channels increases. I think fill_value is not properly reset on fit. Wait until #1737 is in before fixing
Steps/Code to reproduce the bug
This crashes
from aeon.testing.data_generation import make_example_3d_numpy
from aeon.transformations.collection import PaddingTransformer
X, y = make_example_3d_numpy(n_cases=10, n_channels=3, n_timepoints=30)
t = PaddingTransformer.create_test_instance()
t.fit(X, y)
t.transform(X)
X2 = t.fit_transform(X, y)
X, y = make_example_3d_numpy(n_cases=10, n_channels=4, n_timepoints=30)
t.fit(X, y)
t.transform(X)
X2 = t.fit_transform(X, y)
this does not
from aeon.testing.data_generation import make_example_3d_numpy
from aeon.transformations.collection import PaddingTransformer
X, y = make_example_3d_numpy(n_cases=10, n_channels=4, n_timepoints=30)
t = PaddingTransformer.create_test_instance()
t.fit(X, y)
t.transform(X)
X2 = t.fit_transform(X, y)
X, y = make_example_3d_numpy(n_cases=10, n_channels=3, n_timepoints=30)
t.fit(X, y)
t.transform(X)
X2 = t.fit_transform(X, y)
Expected results
not crash
Actual results
Traceback (most recent call last):
File "C:\Code\aeon\aeon\local\transform_debug.py", line 39, in <module>
t.transform(X)
File "C:\Code\aeon\aeon\transformations\collection\base.py", line 156, in transform
Xt = self._transform(X=X_inner, y=y_inner)
File "C:\Code\aeon\aeon\transformations\collection\pad.py", line 168, in _transform
constant_values=self.fill_value[i][j],
IndexError: index 3 is out of bounds for axis 0 with size 3
this is because the constructor attribute is overwritten in fit, rather than stored in fitvalues. This means reset does not change self.fit_values, which also should not be changed in fit
Describe the bug
repeated calls to fit will fail if the number of channels increases. I think fill_value is not properly reset on fit. Wait until #1737 is in before fixing
Steps/Code to reproduce the bug
This crashes
this does not
Expected results
not crash
Actual results
Versions
No response