Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TSInterpolator does not interpolate, it resizes #1156

Open
TonyBagnall opened this issue Feb 8, 2024 · 0 comments · May be fixed by #1737
Open

[BUG] TSInterpolator does not interpolate, it resizes #1156

TonyBagnall opened this issue Feb 8, 2024 · 0 comments · May be fixed by #1737
Labels
enhancement New feature, improvement request or other non-bug code enhancement transformations Transformations package

Comments

@TonyBagnall
Copy link
Contributor

TonyBagnall commented Feb 8, 2024

TSInterpolator

I had assumed that the transformer TSInterpolator interpolated missing values. Instead, it resamples data to make it different length. To me this is resampling not interpolation. It does not have the capability to remove missing values, and even if you give it that capability, it does not remove them. So

from aeon.utils.validation import has_missing
X = np.random.random(size=(10,1,100))
X[0][0][55] = np.nan
print(has_missing(X))
from aeon.transformations.collection import TSInterpolator
interpolator = TSInterpolator(X.shape[2])
X = interpolator.fit_transform(X)
print(has_missing(X))

raises

ValueError: Data seen by instance of TSInterpolator has missing values, but TSInterpolator cannot handle missing values.

If I change "capability:missing_values": True,
it does not remove the missing, even if I resize

from aeon.transformations.collection import TSInterpolator
interpolator = TSInterpolator(X.shape[2]-10)
X = interpolator.fit_transform(X)
print(X.shape," has missing = ",has_missing(X))

even the comments refer to resizing, so its just badly named imo. I think we should rename this to Resizer then having a simple transform Imputer that simply fills in missing values through linear interpolation.

@TonyBagnall TonyBagnall added enhancement New feature, improvement request or other non-bug code enhancement good first issue Good for newcomers transformations Transformations package and removed good first issue Good for newcomers labels Feb 8, 2024
@TonyBagnall TonyBagnall changed the title [ENH] Refactor TSInterpolator as Interpolator [ENH] Implement Interpolator as an alternative to TSInterpolator Feb 8, 2024
@TonyBagnall TonyBagnall changed the title [ENH] Implement Interpolator as an alternative to TSInterpolator [BUG] TSInterpolator does not interpolate, it resizes Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, improvement request or other non-bug code enhancement transformations Transformations package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant