Skip to content

Commit 23bf843

Browse files
committed
xgboosts notes for tidymodels/dials#111
1 parent 8fd1a87 commit 23bf843

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

man/boost_tree.Rd

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/decision_tree.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mlp.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rmd/boost-tree.Rmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ boost_tree() %>%
1818
translate()
1919
```
2020

21+
Note that, for most engines to `boost_tree()`, the `sample_size` argument is in terms of the _number_ of training set points. The `xgboost` package parameterizes this as the _proportion_ of training set samples instead. When using the `tune`, this **occurs automatically**.
22+
23+
If you would like to use a custom range when tuning `sample_size`, the `dials::sample_prop()` function can be used in that case. For example, using a parameter set:
24+
25+
```{r xgb-update, eval = FALSE}
26+
mod <-
27+
boost_tree(sample_size = tune()) %>%
28+
set_engine("xgboost") %>%
29+
set_mode("classification")
30+
31+
# update the parameters using the `dials` function
32+
mod_param <-
33+
mod %>%
34+
parameters() %>%
35+
update(sample_size = sample_prop(c(0.4, 0.9)))
36+
```
37+
38+
Finally, note that `xgboost` models require that non-numeric predictors (e.g., factors) must be converted to dummy variables or some other numeric representation.
39+
2140

2241
## C5.0
2342

0 commit comments

Comments
 (0)