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] Z-normalisation numba function produces wrong results with integer inputs #2250

Closed
baraline opened this issue Oct 25, 2024 · 2 comments · Fixed by #2176
Closed

[BUG] Z-normalisation numba function produces wrong results with integer inputs #2250

baraline opened this issue Oct 25, 2024 · 2 comments · Fixed by #2176
Assignees
Labels
bug Something isn't working

Comments

@baraline
Copy link
Member

baraline commented Oct 25, 2024

Describe the bug

Functions such as z_normalise_series_2d from utils\numba\general.py when used with integer array as inputs ouput an integer array which do not correspond to expected normalization results. The cause is that these functions are using arr = np.zeros_like(X) to create the returned array, which will use the same dtype as the input X.

Replacing this with arr = np.zeros(X.shape) should fix the issue.

Steps/Code to reproduce the bug

from aeon.utils.numba.general import z_normalise_series_2d
z_normalise_series_2d(np.array([[1,2,3]],dtype=int))

Expected results

Out[64]: array([[-1.22474487, 0. , 1.22474487]])

Actual results

Out[65]: array([[-1, 0, 1]])

Versions

No response

@aryan0931
Copy link

hello , I would like to work on this issue.

@baraline
Copy link
Member Author

Hey, sorry, just seen your message, this issue should be fixed with #2176.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants