How to use the mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences function in mlprimitives

To help you get started, we’ve selected a few mlprimitives examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDI-Project / MLPrimitives / tests / custom / test_timeseries_preprocessing.py View on Github external
def _run(self, X, index, expected_X, expected_y, expected_X_index, expected_y_index,
             window_size=2, target_size=1, step_size=1, target_column=0, drop=None,
             drop_windows=False):
        X, y, X_index, y_index = rolling_window_sequences(X, index, window_size, target_size,
                                                          step_size, target_column, drop,
                                                          drop_windows)
        assert_allclose(X.astype(float), expected_X)
        assert_allclose(y.astype(float), expected_y)
        assert_allclose(X_index, expected_X_index)
        assert_allclose(y_index, expected_y_index)