tidymodels / tidymodels/rsample

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

Open
#480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
R
Stars
343
Forks
67
Avg merge
1h 9m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the examples for sliding_window(), sliding_index(), and sliding_period() and inspect the resulting Analysis/Assess/Total summaries. Compare the current Total values with the intended interpretation of observations in the analysis and assessment sets. Done means the behavior is clarified and consistently represented across these entry points.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.