File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ # updating
2+
3+ Code
4+ poisson_reg(penalty = 1) %>% set_engine("glmnet", lambda.min.ratio = 0.001) %>%
5+ update(mixture = tune())
6+ Message
7+ ! parsnip could not locate an implementation for `poisson_reg` model specifications using the `glmnet` engine.
8+ i The parsnip extension package poissonreg implements support for this specification.
9+ i Please install (if needed) and load to continue.
10+ Output
11+ Poisson Regression Model Specification (regression)
12+
13+ Main Arguments:
14+ penalty = 1
15+ mixture = tune()
16+
17+ Engine-Specific Arguments:
18+ lambda.min.ratio = 0.001
19+
20+ Computational engine: glmnet
21+
22+
23+ # bad input
24+
25+ Code
26+ poisson_reg(mode = "bogus")
27+ Condition
28+ Error in `poisson_reg()`:
29+ ! 'bogus' is not a known mode for model `poisson_reg()`.
30+
31+ ---
32+
33+ Code
34+ translate(poisson_reg(mode = "regression"), engine = NULL)
35+ Condition
36+ Error in `translate.default()`:
37+ ! Please set an engine.
38+
39+ ---
40+
41+ Code
42+ poisson_reg(formula = y ~ x)
43+ Condition
44+ Error in `poisson_reg()`:
45+ ! unused argument (formula = y ~ x)
46+
Original file line number Diff line number Diff line change 1+ test_that(" updating" , {
2+ expect_snapshot(
3+ poisson_reg(penalty = 1 ) %> %
4+ set_engine(" glmnet" , lambda.min.ratio = 0.001 ) %> %
5+ update(mixture = tune())
6+ )
7+ })
8+
9+ test_that(" bad input" , {
10+ expect_snapshot(error = TRUE , poisson_reg(mode = " bogus" ))
11+ expect_snapshot(error = TRUE , translate(poisson_reg(mode = " regression" ), engine = NULL ))
12+ expect_snapshot(error = TRUE , poisson_reg(formula = y ~ x ))
13+ })
You can’t perform that action at this time.
0 commit comments