|
1 | 1 | test_that("sparse tibble can be passed to `fit() - supported", { |
2 | 2 | skip_if_not_installed("xgboost") |
| 3 | + # Make materialization of sparse vectors throw an error |
| 4 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
3 | 5 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
4 | 6 |
|
5 | 7 | hotel_data <- sparse_hotel_rates(tibble = TRUE) |
@@ -28,6 +30,8 @@ test_that("sparse tibble can be passed to `fit() - unsupported", { |
28 | 30 |
|
29 | 31 | test_that("sparse matrix can be passed to `fit() - supported", { |
30 | 32 | skip_if_not_installed("xgboost") |
| 33 | + # Make materialization of sparse vectors throw an error |
| 34 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
31 | 35 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
32 | 36 |
|
33 | 37 | hotel_data <- sparse_hotel_rates() |
@@ -57,6 +61,8 @@ test_that("sparse matrix can be passed to `fit() - unsupported", { |
57 | 61 |
|
58 | 62 | test_that("sparse tibble can be passed to `fit_xy() - supported", { |
59 | 63 | skip_if_not_installed("xgboost") |
| 64 | + # Make materialization of sparse vectors throw an error |
| 65 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
60 | 66 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
61 | 67 |
|
62 | 68 | hotel_data <- sparse_hotel_rates(tibble = TRUE) |
@@ -84,6 +90,8 @@ test_that("sparse tibble can be passed to `fit_xy() - unsupported", { |
84 | 90 |
|
85 | 91 | test_that("sparse matrices can be passed to `fit_xy() - supported", { |
86 | 92 | skip_if_not_installed("xgboost") |
| 93 | + # Make materialization of sparse vectors throw an error |
| 94 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
87 | 95 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
88 | 96 |
|
89 | 97 | hotel_data <- sparse_hotel_rates() |
@@ -112,6 +120,8 @@ test_that("sparse matrices can be passed to `fit_xy() - unsupported", { |
112 | 120 |
|
113 | 121 | test_that("sparse tibble can be passed to `predict() - supported", { |
114 | 122 | skip_if_not_installed("ranger") |
| 123 | + # Make materialization of sparse vectors throw an error |
| 124 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
115 | 125 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
116 | 126 |
|
117 | 127 | hotel_data <- sparse_hotel_rates(tibble = TRUE) |
@@ -147,6 +157,8 @@ test_that("sparse tibble can be passed to `predict() - unsupported", { |
147 | 157 |
|
148 | 158 | test_that("sparse matrices can be passed to `predict() - supported", { |
149 | 159 | skip_if_not_installed("ranger") |
| 160 | + # Make materialization of sparse vectors throw an error |
| 161 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
150 | 162 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
151 | 163 |
|
152 | 164 | hotel_data <- sparse_hotel_rates() |
@@ -181,6 +193,8 @@ test_that("sparse matrices can be passed to `predict() - unsupported", { |
181 | 193 |
|
182 | 194 | test_that("sparse data work with xgboost engine", { |
183 | 195 | skip_if_not_installed("xgboost") |
| 196 | + # Make materialization of sparse vectors throw an error |
| 197 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
184 | 198 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
185 | 199 |
|
186 | 200 | spec <- boost_tree() %>% |
@@ -219,6 +233,8 @@ test_that("sparse data work with xgboost engine", { |
219 | 233 |
|
220 | 234 | test_that("to_sparse_data_frame() is used correctly", { |
221 | 235 | skip_if_not_installed("xgboost") |
| 236 | + # Make materialization of sparse vectors throw an error |
| 237 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
222 | 238 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
223 | 239 |
|
224 | 240 | local_mocked_bindings( |
@@ -260,6 +276,8 @@ test_that("to_sparse_data_frame() is used correctly", { |
260 | 276 |
|
261 | 277 | test_that("maybe_sparse_matrix() is used correctly", { |
262 | 278 | skip_if_not_installed("xgboost") |
| 279 | + # Make materialization of sparse vectors throw an error |
| 280 | + # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html |
263 | 281 | withr::local_options("sparsevctrs.verbose_materialize" = 3) |
264 | 282 |
|
265 | 283 | local_mocked_bindings( |
|
0 commit comments