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

sliding_*(): Should Total reflect number of rows in analysis and assessment set combined? #480

Open
hfrick opened this issue May 19, 2024 · 0 comments

Comments

@hfrick
Copy link
Member

hfrick commented May 19, 2024

Should total refer only to those observations used in analysis and assessment set?

library(rsample)
data("Chicago", package = "modeldata")

index <- vctrs::new_date(c(1, 3, 4, 7, 8, 9, 13, 15, 16, 17))
df <- tibble::tibble(x = 1:10, index = index)

sliding_window(df, lookback = 2, assess_stop = 2) |>
  get_rsplit(1)
#> <Analysis/Assess/Total>
#> <3/2/10>

sliding_index(df, index, lookback = 2, assess_stop = 2) |>
  get_rsplit(1)
#> <Analysis/Assess/Total>
#> <2/1/10>

sliding_period(
  Chicago,
  date,
  "year",
  lookback = 2,
  assess_stop = 1
) |> 
  get_rsplit(1)
#> <Analysis/Assess/Total>
#> <1074/366/5698>

Created on 2024-05-19 with reprex v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant