|
4 | 4 | lm_fit <- fit(spec, avg_price_per_room ~ ., data = hotel_data[1:100, ])
|
5 | 5 | Condition
|
6 | 6 | Warning:
|
7 |
| - `data` is a sparse tibble, but `linear_reg()` with engine `lm` doesn't accept that. Converting to non-sparse. |
| 7 | + `data` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse. |
8 | 8 |
|
9 | 9 | # sparse tibble can be passed to `fit_xy()
|
10 | 10 |
|
11 | 11 | Code
|
12 | 12 | lm_fit <- fit_xy(spec, x = hotel_data[1:100, -1], y = hotel_data[1:100, 1])
|
13 | 13 | Condition
|
14 | 14 | Warning:
|
15 |
| - `x` is a sparse tibble, but `linear_reg()` with engine `lm` doesn't accept that. Converting to non-sparse. |
| 15 | + `x` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse. |
16 | 16 |
|
17 | 17 | # sparse matrices can be passed to `fit_xy()
|
18 | 18 |
|
19 | 19 | Code
|
20 | 20 | lm_fit <- fit_xy(spec, x = hotel_data[1:100, -1], y = hotel_data[1:100, 1])
|
21 | 21 | Condition
|
22 | 22 | Error in `fit_xy()`:
|
23 |
| - ! `x` is a sparse matrix, but `linear_reg()` with engine `lm` doesn't accept that. |
| 23 | + ! `x` is a sparse matrix, but `linear_reg()` with engine "lm" doesn't accept that. |
24 | 24 |
|
25 | 25 | # sparse matrices can not be passed to `fit()
|
26 | 26 |
|
|
37 | 37 | preds <- predict(lm_fit, sparse_mtcars)
|
38 | 38 | Condition
|
39 | 39 | Warning:
|
40 |
| - `x` is a sparse tibble, but `linear_reg()` with engine `lm` doesn't accept that. Converting to non-sparse. |
| 40 | + `x` is a sparse tibble, but `linear_reg()` with engine "lm" doesn't accept that. Converting to non-sparse. |
41 | 41 |
|
42 | 42 | # sparse matrices can be passed to `predict()
|
43 | 43 |
|
44 | 44 | Code
|
45 | 45 | predict(lm_fit, sparse_mtcars)
|
46 | 46 | Condition
|
47 | 47 | Error in `predict()`:
|
48 |
| - ! `x` is a sparse matrix, but `linear_reg()` with engine `lm` doesn't accept that. |
| 48 | + ! `x` is a sparse matrix, but `linear_reg()` with engine "lm" doesn't accept that. |
49 | 49 |
|
50 | 50 | # to_sparse_data_frame() is used correctly
|
51 | 51 |
|
|
0 commit comments