Skip to content

Commit

Permalink
fix parsnip v1.2 breaking change (#155)
Browse files Browse the repository at this point in the history
* fix parsnip v1.2 breaking change

* fix a warning in autoplot
  • Loading branch information
cregouby authored Apr 17, 2024
1 parent 3d3ce99 commit 232d89e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

## Bugfixes

* Adapt `tune::finalize_workflow()` test to {parsnip} v1.2 breaking change. (#155)
* `autoplot()` now position the "has_checkpoint" points correctly when a `tabnet_fit()` is continuing a previous training using `tabnet_model =`. (#150)
* Explicitely warn that `tabnet_model` option will not be used in `tabnet_pretrain()` tasks. (#150)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-parsnip.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test_that("Check we can finalize a workflow from a tune_grid", {
control = tune::control_grid(verbose = F)
)

best_rmse <- tune::select_best(at, "rmse")
best_rmse <- tune::select_best(at, metric = "rmse")

expect_no_error(
final_wf <- tune::finalize_workflow(wf, best_rmse)
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ test_that("Autoplot of pretrain then fit scenario, pretrain without checkpoints,
print(autoplot(fit_no_checkpoint))
)
fit_with_checkpoint <- tabnet_fit(Sale_Price ~., data = small_ames, tabnet_model = fit_no_checkpoint, epochs = 2, checkpoint_epoch = 1)
expect_no_error(
print(autoplot(fit_with_checkpoint))
expect_warning(
print(autoplot(fit_with_checkpoint)),
"Removed 2 rows containing missing values"
)

})
Expand Down

0 comments on commit 232d89e

Please sign in to comment.