Main functions doesn't do any input checking on `data` argument

オープン
#474 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
r
領域
data

調査の方向性

Start by reproducing the reported cases for the bootstraps and vfold_cv entry points with the invalid data values shown in the issue. Review how these functions currently handle those inputs and add input checking so invalid data produces an appropriate error rather than an empty result or an internal error; add tests for the examples.

索引モデルが issue の本文から書いたものです。

説明

feature

sooo, there isn't much input checking for some of the main functions here in {rsample}, to the point of bootstraps(bootstraps) not returning an error 😬

bootstraps

library(rsample)

mat_cars <- as.matrix(mtcars)

bootstraps(mat_cars, times = 2)
#> # Bootstrap sampling 
#> # A tibble: 2 × 2
#>   splits          id        
#>   <list>          <chr>     
#> 1 <split [32/11]> Bootstrap1
#> 2 <split [32/11]> Bootstrap2

bootstraps(1:10, times = 2)
#> # Bootstrap sampling 
#> # A tibble: 0 × 2
#> # ℹ 2 variables: splits <list>, id <chr>

bootstraps(NULL)
#> # Bootstrap sampling 
#> # A tibble: 0 × 2
#> # ℹ 2 variables: splits <list>, id <chr>

bootstraps(lm(mpg ~ disp, data = mtcars))
#> # Bootstrap sampling 
#> # A tibble: 0 × 2
#> # ℹ 2 variables: splits <list>, id <chr>

vfold_cv

library(rsample)

mat_cars <- as.matrix(mtcars)

vfold_cv(mat_cars)
#> #  10-fold cross-validation 
#> # A tibble: 10 × 2
#>    splits         id    
#>    <list>         <chr> 
#>  1 <split [28/4]> Fold01
#>  2 <split [28/4]> Fold02
#>  3 <split [29/3]> Fold03
#>  4 <split [29/3]> Fold04
#>  5 <split [29/3]> Fold05
#>  6 <split [29/3]> Fold06
#>  7 <split [29/3]> Fold07
#>  8 <split [29/3]> Fold08
#>  9 <split [29/3]> Fold09
#> 10 <split [29/3]> Fold10

vfold_cv(1:10)
#> Error in if (v > max_v) {: argument is of length zero

vfold_cv(NULL)
#> Error in if (v > max_v) {: argument is of length zero

vfold_cv(lm(mpg ~ disp, data = mtcars))
#> Error in if (v > max_v) {: argument is of length zero
主要言語
R
スター
343
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tidymodels/rsample のほかの issue

tidymodels/rsample の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。