Skip to content

Commit

Permalink
Merge branch 'main' into no-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo authored Jan 28, 2025
2 parents df07110 + 9cfcb7f commit 039d511
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

* Fixed bug related to using local (non-package) models (#1229)

* `tunable()` now references a dials object for the `mixture` parameter (#1236)

## Breaking Change

* For quantile prediction, the `quantile` argument to `predict()` has been deprecate in facor of `quantile_levels`. This does not affect models with mode `"quantile regression"`.
Expand Down
5 changes: 2 additions & 3 deletions R/tunable.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,9 @@ brulee_mlp_engine_args <-
"largest", list(pkg = "dials", fun = "rate_largest"),
"rate_schedule", list(pkg = "dials", fun = "rate_schedule"),
"step_size", list(pkg = "dials", fun = "rate_step_size"),
"steps", list(pkg = "dials", fun = "rate_steps")
"mixture", list(pkg = "dials", fun = "mixture")
) %>%
dplyr::mutate(,
source = "model_spec",
dplyr::mutate(source = "model_spec",
component = "mlp",
component_id = "engine"
)
Expand Down
3 changes: 2 additions & 1 deletion parsnip.Rproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Version: 1.0
ProjectId: e5169c4e-5aba-443d-938b-8765efc1d040
ProjectId: 7f6c9ff5-6b9a-4235-8666-12db5ef65d49


RestoreWorkspace: No
SaveWorkspace: No
Expand Down
22 changes: 22 additions & 0 deletions tests/testthat/test-tunable.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test_that('brulee has mixture object', {
# for issue 1236
mlp_spec <-
mlp(
hidden_units = tune(),
activation = tune(),
penalty = tune(),
learn_rate = tune(),
epoch = 2000
) %>%
set_mode("regression") %>%
set_engine("brulee",
stop_iter = tune(),
mixture = tune(),
rate_schedule = tune())

brulee_res <- tunable(mlp_spec)

expect_true(
length(brulee_res$call_info[brulee_res$name == "mixture"]) > 0
)
})

0 comments on commit 039d511

Please sign in to comment.