Skip to content

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

@graceyesong

Description

@graceyesong
  • 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())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions