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

'mlstars.custom.timeseries_preprocessing.rolling_window_sequences' target_size = 0 #13

Open
graceyesong opened this issue Mar 5, 2024 · 0 comments

Comments

@graceyesong
Copy link

  • ml-stars version: 0.1.1
  • Python version: 3.8
  • Operating System: MacOS

Description

I am trying to create rolling window sequences to feed as input to a reconstruction model (LSTM-AE). Since it's not prediction, you want target_size = 0 so that the last window contains the last point, i.e. all points are captured in the window sequences. However, setting target_size = 0 raises an indexing error at line 108 aka

y_index.append(index[end + offset])

in mlstars/custom/timeseries_preprocessing.py.

What I Did

sample = 'E-10'
train_data = load_signal('multivariate/' + sample)
train_data.head()

window = 100
primitive = load_primitive('mlstars.custom.timeseries_preprocessing.rolling_window_sequences',
                           arguments = {
                               'index': train_data.index,
                               'window_size': window, 
                               'target_size': 0,
                               'step_size': 1,
                               'target_column': None
                           })

X, y, index, target_index = primitive.produce(X=train_data.drop('timestamp', axis=1).to_numpy())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant