Sorting of strata in training data from initial_split
还没有人认领这个 Issue。
评估
调研方向
Start with the initial_split entry point and inspect how training() and testing() expose the split when strata=y. Reproduce the supplied R example, then verify that the training data is not grouped by the strata variable by default while stratified sampling still works as intended.
由索引模型根据 Issue 内容生成。
描述
I have just completed running a kaggle challenge for my machine learning class. I had a surprise that the training data is sorted by the variable used for strata:
# Here is code to reproduce
set.seed(921)
d <- tibble(x=runif(100), y=sample(c("y", "n"), 100, replace=TRUE))
d_split <- initial_split(d, strata=y)
d_tr <- training(d_split)
d_tr$y
d_ts <- testing(d_split)
d_ts$y
and we find
> d_tr$y
[1] "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"
[13] "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"
[25] "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n" "n"
[37] "n" "n" "y" "y" "y" "y" "y" "y" "y" "y" "y" "y"
[49] "y" "y" "y" "y" "y" "y" "y" "y" "y" "y" "y" "y"
[61] "y" "y" "y" "y" "y" "y" "y" "y" "y" "y" "y" "y"
[73] "y" "y"
although test set is not (luckily for me!)
d_ts$y
[1] "n" "n" "n" "n" "y" "y" "n" "y" "y" "y" "y" "y"
[13] "y" "y" "y" "n" "n" "n" "n" "n" "y" "y" "n" "y"
[25] "n" "n"
I'm not sure if this is intentional but it would be better to have the default be that these are in a random order, with an input parameter to sort being optional.
- 主要语言
- R
- 星标
- 343
- 派生
- 68
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tidymodels/rsample 的其他 Issue
-
tidy-dev-day :nerd_face:
难度 1/5 1-3 小时 新手友好度 92/100
tidymodels/rsample#611 ·
-
repeats attribute is hardcoded to 1 for group_vfold_cv()可能已有人在做 @taekop 于 31 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
tidymodels/rsample#607 ·
-
难度 4/5 3-5 天 新手友好度 68/100
tidymodels/rsample#618 ·
-
documentation
难度 3/5 1-2 天 新手友好度 68/100
tidymodels/rsample#608 ·
-
难度 5/5 一周以上 新手友好度 25/100
tidymodels/rsample#600 ·
查看 tidymodels/rsample 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
-
`latest` pre-release missing: Package run deleted it, then `gh release create` failed with HTTP 403未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
DESEQ2_NORM ignores sizefactors_from_controls, causing inconsistent normalization可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
nf-core/differentialabundance#770 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
waldronlab/bugphyzz#256 ·