Skip to content

Commit 0c90d72

Browse files
committed
removed others references
1 parent c90b698 commit 0c90d72

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vignettes/articles/Scratch.Rmd

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,10 @@ There are some models (e.g. `glmnet`, `plsr`, `Cubust`, etc.) that can make pred
346346
For example, if I fit a linear regression model via `glmnet` and get four values of the regularization parameter (`lambda`):
347347

348348
```{r glmnet, eval = FALSE}
349-
linear_reg(others = list(nlambda = 4)) %>%
350-
fit(mpg ~ ., data = mtcars, engine = "glmnet") %>%
351-
predict(newdata = mtcars[1:3, -1])
349+
linear_reg() %>%
350+
set_engine("glmnet", nlambda = 4) %>%
351+
fit(mpg ~ ., data = mtcars) %>%
352+
multi_predict(new_data = mtcars[1:3, -1])
352353
```
353354

354355
_However_, the api is still being developed. Currently, there is not an interface in the prediction functions to pass in the values of the parameters to make predictions with (`lambda`, in this case).
@@ -368,8 +369,9 @@ logistic_reg() %>% translate(engine = "glm")
368369
369370
# but you can change it:
370371
371-
logistic_reg(others = list(family = expr(binomial(link = "probit")))) %>%
372-
translate(engine = "glm")
372+
logistic_reg() %>%
373+
set_engine("glm", family = expr(binomial(link = "probit"))) %>%
374+
translate()
373375
```
374376

375377
That's what `defaults` are for.

0 commit comments

Comments
 (0)