Skip to content

Commit

Permalink
deprecate rolling_origin, issue #448
Browse files Browse the repository at this point in the history
  • Loading branch information
nmercadeb committed Aug 15, 2024
1 parent 5eb77d4 commit bdda1c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions R/rolling_origin.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
#' @export
rolling_origin <- function(data, initial = 5, assess = 1,
cumulative = TRUE, skip = 0, lag = 0, ...) {

lifecycle::signal_stage(
stage = "superseded", what = "rolling_origin()",
with = I("sliding_window(), sliding_index() and sliding_period()")
)

check_dots_empty()

n <- nrow(data)
Expand Down
8 changes: 0 additions & 8 deletions vignettes/Common_Patterns.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,3 @@ sliding_period(Chicago, date, "year") %>%
head(2)
```

All of these functions produce analysis sets of the same size, with the start and end of the analysis set "sliding" down your data frame. If you'd rather have your analysis set get progressively larger, so that you're predicting new data based upon a growing set of older observations, you can use the `rolling_origin()` function:

```{r}
rolling_origin(Chicago) %>%
head(2)
```

Note that all of these time-based resampling functions are deterministic: unlike the rest of the package, running these functions repeatedly under different random seeds will always return the same results.

0 comments on commit bdda1c5

Please sign in to comment.