Sorting of strata in training data from initial_split
まだ誰も着手していません。
評価
調査の方向性
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 ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 が 29 日前に担当しました。 オープン
難易度 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 1週間以上 初心者へのやさしさ 25/100
tidymodels/rsample#600 ·
tidymodels/rsample の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
OHDSI/PatientLevelPrediction#688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rfordatascience/tidytuesday#1098 ·