@@ -9,7 +9,7 @@ test_that("sparse tibble can be passed to `fit() - supported", {
99 spec <- boost_tree() %> %
1010 set_mode(" regression" ) %> %
1111 set_engine(" xgboost" )
12-
12+
1313 expect_snapshot(
1414 error = TRUE ,
1515 xgb_fit <- fit(spec , avg_price_per_room ~ . , data = hotel_data )
@@ -33,9 +33,9 @@ test_that("sparse matrix can be passed to `fit() - supported", {
3333 # Make materialization of sparse vectors throw an error
3434 # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
3535 withr :: local_options(" sparsevctrs.verbose_materialize" = 3 )
36-
36+
3737 hotel_data <- sparse_hotel_rates()
38-
38+
3939 spec <- boost_tree() %> %
4040 set_mode(" regression" ) %> %
4141 set_engine(" xgboost" )
@@ -64,7 +64,7 @@ test_that("sparse tibble can be passed to `fit_xy() - supported", {
6464 # Make materialization of sparse vectors throw an error
6565 # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
6666 withr :: local_options(" sparsevctrs.verbose_materialize" = 3 )
67-
67+
6868 hotel_data <- sparse_hotel_rates(tibble = TRUE )
6969
7070 spec <- boost_tree() %> %
@@ -206,7 +206,7 @@ test_that("sparse data work with xgboost engine", {
206206 expect_no_error(
207207 xgb_fit <- fit_xy(spec , x = hotel_data [, - 1 ], y = hotel_data [, 1 ])
208208 )
209-
209+
210210 expect_no_error(
211211 predict(xgb_fit , hotel_data )
212212 )
@@ -221,7 +221,7 @@ test_that("sparse data work with xgboost engine", {
221221 expect_no_error(
222222 predict(xgb_fit , hotel_data )
223223 )
224-
224+
225225 expect_no_error(
226226 xgb_fit <- fit_xy(spec , x = hotel_data [, - 1 ], y = hotel_data [, 1 ])
227227 )
@@ -236,7 +236,7 @@ test_that("to_sparse_data_frame() is used correctly", {
236236 # Make materialization of sparse vectors throw an error
237237 # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
238238 withr :: local_options(" sparsevctrs.verbose_materialize" = 3 )
239-
239+
240240 local_mocked_bindings(
241241 to_sparse_data_frame = function (x , object ) {
242242 if (methods :: is(x , " sparseMatrix" )) {
@@ -263,7 +263,7 @@ test_that("to_sparse_data_frame() is used correctly", {
263263 error = TRUE ,
264264 fit_xy(spec , x = hotel_data [, - 1 ], y = hotel_data [, 1 ])
265265 )
266-
266+
267267 spec <- boost_tree() %> %
268268 set_mode(" regression" ) %> %
269269 set_engine(" xgboost" )
@@ -279,7 +279,7 @@ test_that("maybe_sparse_matrix() is used correctly", {
279279 # Make materialization of sparse vectors throw an error
280280 # https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
281281 withr :: local_options(" sparsevctrs.verbose_materialize" = 3 )
282-
282+
283283 local_mocked_bindings(
284284 maybe_sparse_matrix = function (x ) {
285285 if (sparsevctrs :: has_sparse_elements(x )) {
0 commit comments