Repository navigation
Conversation
Thank you for contributing to
|
799bb94 to
a349ce5
Compare
| When working with unequal length series, Normalizer is only able to | ||
| use list of 2D arrays with shape (n_channels, n_timepoints_i). |
There was a problem hiding this comment.
this is in the incorrect space it looks like. Should be above the parameters or in notes. Take a look at the numpydoc specification.
| def __init__(self, mean: float = 0.0, std: float = 1.0, axis: int = -1): | ||
| super().__init__() | ||
| self.mean = mean | ||
| self.std = std | ||
| self.axis = axis |
There was a problem hiding this comment.
-
Can we put the parameter setting before the init.
-
is the axis parameter ever used for the list input? I think we need some tests for different datatypes with axis if we are going to include it. The general testing will only catch issues with -1.
|
|
||
| _tags = { | ||
| "X_inner_type": ["numpy3D", "np-list"], | ||
| "X_inner_type": ["numpy2D", "numpy3D", "np-list"], |
There was a problem hiding this comment.
This will make it so that the output can also be 2d, which is probably not a bad thing, but could be handled differently as well.
Any rationale for handling both 2d and 3d internally?
| axis: int, default=-1 | ||
| Axis along which to compute the mean and standard deviation. Default is -1, | ||
| which corresponds to the last axis (timepoints axis). |
There was a problem hiding this comment.
is 0 a valid value for this? i would then normalise by case with out datatypes, not sure if that is something you ever want to do.
|
Hello, Thanks for the review. Considering your remarks, here is my updated code. I hope it is clearer and helps answer your questions.
It was not; the new commit, now allows it.
I'm still relatively new to aeon, so could you explain the reasoning behind this convention? I would normally call super().init() first, then initialize the parameters. I'm wondering whether assigning them before the parent initialization could cause issues, particularly when overriding or extending default parameter values in child classes.
While running an experiment for another PR, implementing a Transformer model in the forecasting module, I needed scalers for 2D arrays with a configurable axis parameter. (As deep learning models in forecasting use 2D arrays that can be either I understand that 2D arrays of shape
Yes, 0 is a valid value, especially for 2D arrays, shaped |
Reference Issues/PRs
Fixes #3907
What does this implement/fix? Explain your changes.
This PR extends
Normalizer,MinMaxScaler, andCentererparameters.It adds an axis parameter allowing to define the index of the time axis in the input serie/collection.
Changing the axis can, for example, be useful for preprocessing datasets for forecasting tasks.
Normalizer: addsmean,std, andaxis.MinMaxScaler: addsaxis, retainingminandmax.Centerer: addsmeanandaxis.Default parameters preserve existing behavior. For NumPy arrays,
axisdetermines how statistics are computed. Unequal-lengthseries retain per-series normalization along the time axis.
Does your contribution introduce a new dependency? If yes, which one?
No.
Any other comments?
PR checklist
For all contributions
For new estimators and functions
__maintainer__at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access