Skip to content

Commit a0e1b2a

Browse files
catboost parameter updates (#119)
Co-authored-by: Emil Hvitfeldt <[email protected]>
1 parent da16cc1 commit a0e1b2a

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

.Rbuildignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ inst/figs/
1212
^README\.Rmd$
1313
^[\.]?air\.toml$
1414
^\.vscode$
15-
^revdep$
15+
^revdep$
16+
^train_dir$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ revdep/library.noindex
1111
revdep/data.sqlite
1212
.httr-oauth
1313
revdep/cloud.noindex/*
14+
train_dir/

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ License: MIT + file LICENSE
2626
URL: https://bonsai.tidymodels.org/, https://github.com/tidymodels/bonsai
2727
BugReports: https://github.com/tidymodels/bonsai/issues
2828
Depends:
29-
parsnip (>= 1.0.1),
29+
parsnip (>= 1.3.3.9000),
3030
R (>= 4.1)
3131
Imports:
3232
cli,
@@ -52,9 +52,11 @@ Suggests:
5252
tune
5353
VignetteBuilder:
5454
knitr
55+
Remotes:
56+
tidymodels/parsnip
5557
Config/Needs/website: tidyverse/tidytemplate
5658
Config/testthat/edition: 3
5759
Config/usethis/last-upkeep: 2025-04-25
5860
Encoding: UTF-8
5961
Roxygen: list(markdown = TRUE)
60-
RoxygenNote: 7.3.2
62+
RoxygenNote: 7.3.3

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# bonsai (development version)
22

3+
* catboost tuning parameters were updates: (#119)
4+
- Fixed a bug in `mtry`; it used the parsnip name `mtry_prop`.
5+
- Enabled model arguments for `min_n`, `sample_size`, and `stop_iter`. `min_n` is only enabled for GPU computations.
6+
37
# bonsai 0.4.0
48

59
## New Engines

R/catboost_data.R

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,38 @@ make_boost_tree_catboost <- function() {
184184
parsnip::set_model_arg(
185185
model = "boost_tree",
186186
eng = "catboost",
187-
parsnip = "mtry_prop",
187+
parsnip = "mtry",
188188
original = "rsm",
189189
func = list(pkg = "dials", fun = "mtry_prop"),
190190
has_submodel = FALSE
191191
)
192+
193+
parsnip::set_model_arg(
194+
model = "boost_tree",
195+
eng = "catboost",
196+
parsnip = "min_n",
197+
original = "min_data_in_leaf",
198+
func = list(pkg = "dials", fun = "min_n"),
199+
has_submodel = FALSE
200+
)
201+
202+
parsnip::set_model_arg(
203+
model = "boost_tree",
204+
eng = "catboost",
205+
parsnip = "sample_size",
206+
original = "subsample",
207+
func = list(pkg = "dials", fun = "sample_prop"),
208+
has_submodel = FALSE
209+
)
210+
211+
parsnip::set_model_arg(
212+
model = "boost_tree",
213+
eng = "catboost",
214+
parsnip = "stop_iter",
215+
original = "early_stopping_rounds",
216+
func = list(pkg = "dials", fun = "stop_iter"),
217+
has_submodel = FALSE
218+
)
192219
}
193220

194221
# nocov end

man/bonsai-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)