View source: R/ts_projection.R
| ts_projection | R Documentation |
Split a ts_data (sliding windows) into input features and
output targets for modeling.
ts_projection(ts)
ts |
Matrix or data.frame containing a |
For a multi-column ts_data, returns all but the last column as
inputs and the last column as the output. For a single-row matrix, returns
ts_data-wrapped inputs/outputs preserving names and window size.
A ts_projection object with two elements: $input and $output.
# Setting up a ts_data and projecting (X, y)
# Load example dataset and create windows
data(tsd)
ts <- ts_data(tsd$y, 10)
io <- ts_projection(ts)
# Input data (features)
ts_head(io$input)
# Output data (target)
ts_head(io$output)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.