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

Add offset to rolling_window_sequence primitive #251

Closed
skyeeiskowitz opened this issue Dec 21, 2020 · 1 comment · Fixed by #254
Closed

Add offset to rolling_window_sequence primitive #251

skyeeiskowitz opened this issue Dec 21, 2020 · 1 comment · Fixed by #254
Assignees
Labels
approved The issue is approved and someone can start working on it primitive improvement An improvement over an existing primitive
Milestone

Comments

@skyeeiskowitz
Copy link
Contributor

  • MLPrimitives version: v0.2.5
  • Python version: 3.6
  • Operating System: MacOS Catalina

Description

Add new offset argument to mlprimitives/primitives/mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences.json

The offset indicates the number of steps that will be created between the input and the target sequence.

What I Did

Added argument offset=0 to the rolling_window_sequences function in mlprimitives/custom/timeseries_preprocessing.py
Added docstring describing offset
Changed max_start:

max_start = len(X) - window_size - target_size - offset + 1

Changed out_y and y_index:

        out_y.append(target[end + offset:end + offset + target_size])
        y_index.append(index[end + offset])

Added fixed hyperparameter to the primitive json mlprimitives/primitives/mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences.json

            "offset": {
                "type": "int",
                "default": 0
            }
@csala csala added the primitive improvement An improvement over an existing primitive label Dec 22, 2020
@csala csala added this to the 0.3.0 milestone Dec 22, 2020
@csala csala added the approved The issue is approved and someone can start working on it label Dec 22, 2020
@csala
Copy link
Contributor

csala commented Dec 22, 2020

Sounds good @skyeeiskowitz ! Please go ahead and do a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved The issue is approved and someone can start working on it primitive improvement An improvement over an existing primitive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants