Skip to content

Commit 68c25e9

Browse files
authored
Merge pull request #25 from tidymodels/tuning-updates
Tuning updates
2 parents cdabcf2 + be74b9a commit 68c25e9

File tree

5 files changed

+94
-1
lines changed

5 files changed

+94
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 0.0.3.9000
33
Title: Extra Recipes for Encoding Categorical Predictors
44
Description: Predictors can be converted to one or more numeric representations using simple generalized linear models <arXiv:1611.09477> or nonlinear models <arXiv:1604.06737>. All encoding methods are supervised.
55
Authors@R: c(
6-
person("Max", "Kuhn", , "[email protected]", c("aut", "cre")),
6+
person(given = "Max", family = "Kuhn", email = "[email protected]", role = c("aut", "cre")),
77
person("RStudio", role = "cph"))
88
Depends:
99
R (>= 3.1),

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export(tidy.step_lencode_bayes)
3838
export(tidy.step_lencode_glm)
3939
export(tidy.step_lencode_mixed)
4040
export(tidy.step_umap)
41+
export(tunable.step_embed)
42+
export(tunable.step_umap)
43+
export(tunable.step_woe)
4144
import(rlang)
4245
importFrom(dplyr,"%>%")
4346
importFrom(dplyr,arrange)

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# `embed` 0.0.4
2+
3+
* Methods were added for a future generic called `tunable()`. This outlines which parameters in a step can/could be tuned.
4+
5+
* Small updates to work with different versions of `tidyr`.
6+
7+
18
# `embed` 0.0.3
29

310
## New Steps

R/tunable.R

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#' tunable methods for embed
2+
#'
3+
#' These functions define what parameters _can_ be tuned for specific steps.
4+
#' They also define the recommended objects from the `dials` package that can
5+
#' be used to generate new parameter values and other characteristics.
6+
#' @param x A recipe step object
7+
#' @param ... Not used.
8+
#' @return A tibble object.
9+
#' @keywords internal
10+
#' @export
11+
tunable.step_embed <- function(x, ...) {
12+
tibble::tibble(
13+
name = c("num_terms", "hidden_units"),
14+
call_info = list(
15+
list(pkg = "dials", fun = "num_terms", range = c(2, 10)),
16+
list(pkg = "dials", fun = "hidden_units", range = c(0, 10))
17+
),
18+
source = "recipe",
19+
component = "step_embed",
20+
component_id = x$id
21+
)
22+
}
23+
24+
25+
#' @export
26+
#' @rdname tunable.step_embed
27+
tunable.step_umap <- function(x, ...) {
28+
tibble::tibble(
29+
name = c("num_comp", "neighbors", "min_dist", "learn_rate", "epochs"),
30+
call_info = list(
31+
list(pkg = "dials", fun = "num_comp", range = c(1, 10)),
32+
list(pkg = "dials", fun = "neighbors", range = c(5, 25)),
33+
list(pkg = "dials", fun = "min_dist", range = c(-4, 0)),
34+
list(pkg = "dials", fun = "learn_rate"),
35+
list(pkg = "dials", fun = "epochs", range = c(100, 700))
36+
),
37+
source = "recipe",
38+
component = "step_umap",
39+
component_id = x$id
40+
)
41+
}
42+
43+
#' @export
44+
#' @rdname tunable.step_embed
45+
tunable.step_woe <- function(x, ...) {
46+
tibble::tibble(
47+
name = "Laplace",
48+
call_info = list(
49+
list(pkg = "dials", fun = "Laplace")
50+
),
51+
source = "recipe",
52+
component = "step_woe",
53+
component_id = x$id
54+
)
55+
}

man/tunable.step_embed.Rd

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

0 commit comments

Comments
 (0)