Code
xgb_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data)
Condition
Error in `fit()`:
! Sparse data cannot be used with formula interface. Please use `fit_xy()` instead.
Code
lm_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data[1:100, ])
Condition
Warning:
`data` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse.
Code
xgb_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data)
Condition
Error in `fit()`:
! Sparse data cannot be used with formula interface. Please use `fit_xy()` instead.
Code
lm_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data[1:100, ])
Condition
Warning:
`data` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse.
Code
lm_fit <- fit_xy(spec, x = hotel_data[1:100, -1], y = hotel_data[1:100, 1])
Condition
Warning:
`x` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse.
Code
lm_fit <- fit_xy(spec, x = hotel_data[1:100, -1], y = hotel_data[1:100, 1])
Condition
Error in `fit_xy()`:
! `x` is a sparse matrix, but `linear_reg()` with engine "lm" doesn't accept that.
Code
preds <- predict(lm_fit, sparse_mtcars)
Condition
Warning:
`x` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse.
Code
predict(lm_fit, sparse_mtcars)
Condition
Error in `predict()`:
! `x` is a sparse matrix, but `linear_reg()` with engine "lm" doesn't accept that.
Code
xgb_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data)
Condition
Error in `fit()`:
! Sparse data cannot be used with formula interface. Please use `fit_xy()` instead.
Code
fit_xy(spec, x = mtcars[, -1], y = mtcars[, 1])
Condition
Error in `to_sparse_data_frame()`:
! x is not sparse
Code
fit_xy(spec, x = hotel_data[, -1], y = hotel_data[, 1])
Condition
Error in `to_sparse_data_frame()`:
! x is spare, and sparse is not allowed
Code
fit_xy(spec, x = hotel_data[, -1], y = hotel_data[, 1])
Condition
Error in `to_sparse_data_frame()`:
! x is spare, and sparse is allowed
Code
fit_xy(spec, x = hotel_data[, -1], y = hotel_data[, 1])
Condition
Error in `maybe_sparse_matrix()`:
! sparse vectors detected
Code
fit_xy(spec, x = mtcars[, -1], y = mtcars[, 1])
Condition
Error in `maybe_sparse_matrix()`:
! no sparse vectors detected
Code
fit_xy(spec, x = as.data.frame(mtcars)[, -1], y = as.data.frame(mtcars)[, 1])
Condition
Error in `maybe_sparse_matrix()`:
! no sparse vectors detected
Code
fit_xy(spec, x = tibble::as_tibble(mtcars)[, -1], y = tibble::as_tibble(mtcars)[,
1])
Condition
Error in `maybe_sparse_matrix()`:
! no sparse vectors detected
Code
predict(lm_fit, hotel_data)
Condition
Error in `predict.elnet()`:
! data is sparse
Code
fit(spec, avg_price_per_room ~ ., data = hotel_data)
Condition
Error in `fit()`:
! `x` must have column names.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.