Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to and for scales v1.3.0 #323

Merged
merged 8 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ URL: https://dials.tidymodels.org, https://github.com/tidymodels/dials
BugReports: https://github.com/tidymodels/dials/issues
Depends:
R (>= 3.4),
scales
scales (>= 1.3.0)
Imports:
cli,
DiceDesign,
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ importFrom(purrr,map_dfc)
importFrom(purrr,map_int)
importFrom(purrr,map_lgl)
importFrom(scales,is.trans)
importFrom(scales,log10_trans)
importFrom(scales,log2_trans)
importFrom(scales,transform_log10)
importFrom(scales,transform_log2)
importFrom(stats,runif)
importFrom(tibble,as_tibble)
importFrom(tibble,is_tibble)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# dials (development version)

* Improving error messages by switching to cli (#315).
* Improving error messages by switching to cli (#315, #317, #321).

* Update usage of tranformation functions from the scales package to their new names and require the corresponding version v1.3.0 (#323).


# dials 1.2.0
Expand Down
2 changes: 1 addition & 1 deletion R/dials-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' @importFrom lifecycle deprecated
#' @importFrom pillar type_sum
#' @importFrom purrr map_lgl map2_dfc map_chr map map2 map_dfc map_dbl map_int
#' @importFrom scales log2_trans is.trans log10_trans
#' @importFrom scales transform_log2 is.trans transform_log10
#' @importFrom stats runif
#' @importFrom tibble as_tibble is_tibble tibble new_tibble
#' @importFrom utils installed.packages globalVariables
Expand Down
2 changes: 1 addition & 1 deletion R/param_Laplace.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' these values should be in the _transformed units_.
#'
#' @param trans A `trans` object from the `scales` package, such as
#' `scales::log10_trans()` or `scales::reciprocal_trans()`. If not provided,
#' `scales::transform_log10()` or `scales::transform_reciprocal()`. If not provided,
#' the default is used which matches the units used in `range`. If no
#' transformation, `NULL`.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/param_engine_c50.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' rule_bands()
#' @rdname c5_parameters
#' @export
confidence_factor <- function(range = c(-1, 0), trans = log10_trans()) {
confidence_factor <- function(range = c(-1, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
4 changes: 2 additions & 2 deletions R/param_engine_partykit.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' largest possible values, respectively.
#'
#' @param trans A `trans` object from the `scales` package, such as
#' `scales::log10_trans()` or `scales::reciprocal_trans()`. If not provided,
#' `scales::transform_log10()` or `scales::transform_reciprocal()`. If not provided,
#' the default is used which matches the units used in `range`. If no
#' transformation, `NULL`.
#' @param values A character string of possible values.
Expand All @@ -15,7 +15,7 @@
#' 0.99997 in the natural units. For several test types, this parameter
#' corresponds to `1 - {p-value}`.
#' @export
conditional_min_criterion <- function(range = c(1.386294, 15), trans = scales::logit_trans()) {
conditional_min_criterion <- function(range = c(1.386294, 15), trans = scales::transform_logit()) {
dials::new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_engine_ranger.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ regularize_depth <- function(values = c(TRUE, FALSE)) {

#' @export
#' @rdname ranger_parameters
significance_threshold <- function(range = c(-10, 0), trans = log10_trans()) {
significance_threshold <- function(range = c(-10, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
4 changes: 2 additions & 2 deletions R/param_engine_xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ scale_pos_weight <- function(range = c(0.8, 1.2), trans = NULL) {

#' @rdname xgboost_parameters
#' @export
penalty_L2 <- function(range = c(-10, 1), trans = log10_trans()) {
penalty_L2 <- function(range = c(-10, 1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand All @@ -41,7 +41,7 @@ penalty_L2 <- function(range = c(-10, 1), trans = log10_trans()) {

#' @rdname xgboost_parameters
#' @export
penalty_L1 <- function(range = c(-10, 1), trans = log10_trans()) {
penalty_L1 <- function(range = c(-10, 1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
4 changes: 2 additions & 2 deletions R/param_kernel.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' scale_factor()
#' kernel_offset()
#' @export
rbf_sigma <- function(range = c(-10, 0), trans = log10_trans()) {
rbf_sigma <- function(range = c(-10, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand All @@ -23,7 +23,7 @@ rbf_sigma <- function(range = c(-10, 0), trans = log10_trans()) {

#' @rdname rbf_sigma
#' @export
scale_factor <- function(range = c(-10, -1), trans = log10_trans()) {
scale_factor <- function(range = c(-10, -1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_learn_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @examples
#' learn_rate()
#' @export
learn_rate <- function(range = c(-10, -1), trans = log10_trans()) {
learn_rate <- function(range = c(-10, -1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_min_dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @examples
#' min_dist()
#' @export
min_dist <- function(range = c(-4, 0), trans = log10_trans()) {
min_dist <- function(range = c(-4, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_mtry.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mtry <- function(range = c(1L, unknown()), trans = NULL) {

#' @export
#' @rdname mtry
mtry_long <- function(range = c(0L, unknown()), trans = log10_trans()) {
mtry_long <- function(range = c(0L, unknown()), trans = transform_log10()) {
new_quant_param(
type = "integer",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ hidden_units <- function(range = c(1L, 10L), trans = NULL) {

#' @export
#' @rdname dropout
batch_size <- function(range = c(unknown(), unknown()), trans = log2_trans()) {
batch_size <- function(range = c(unknown(), unknown()), trans = transform_log2()) {
new_quant_param(
type = "integer",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_num_hash.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' signed_hash()
#' @export
#' @rdname texthash
num_hash <- function(range = c(8L, 12L), trans = log2_trans()) {
num_hash <- function(range = c(8L, 12L), trans = transform_log2()) {
new_quant_param(
type = "integer",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_penalty.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @examples
#' penalty()
#' @export
penalty <- function(range = c(-10, 0), trans = log10_trans()) {
penalty <- function(range = c(-10, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
4 changes: 2 additions & 2 deletions R/param_schedulers.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @name scheduler-param
#' @export
rate_initial <- function (range = c(-3,-1), trans = log10_trans()) {
rate_initial <- function (range = c(-3,-1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand All @@ -33,7 +33,7 @@ rate_initial <- function (range = c(-3,-1), trans = log10_trans()) {

#' @rdname scheduler-param
#' @export
rate_largest <- function (range = c(-1, -1 / 2), trans = log10_trans()) {
rate_largest <- function (range = c(-1, -1 / 2), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_sparse_bayes_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @examples
#' mixture()
#' @export
prior_slab_dispersion <- function(range = c(-1/2, log10(3)), trans = log10_trans()) {
prior_slab_dispersion <- function(range = c(-1/2, log10(3)), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_svm.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' cost()
#' svm_margin()
#' @export
cost <- function(range = c(-10, 5), trans = log2_trans()) {
cost <- function(range = c(-10, 5), trans = transform_log2()) {
new_quant_param(
type = "double",
range = range,
Expand Down
4 changes: 2 additions & 2 deletions R/param_trees.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sample_prop <- function(range = c(1/10, 1), trans = NULL) {

#' @rdname trees
#' @export
loss_reduction <- function(range = c(-10, 1.5), trans = log10_trans()) {
loss_reduction <- function(range = c(-10, 1.5), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down Expand Up @@ -133,7 +133,7 @@ prune <- function(values = c(TRUE, FALSE)) {

#' @export
#' @rdname trees
cost_complexity <- function(range = c(-10, -1), trans = log10_trans()) {
cost_complexity <- function(range = c(-10, -1), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/param_weight.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @examples
#' weight()
#' @export
weight <- function(range = c(-10, 0), trans = log10_trans()) {
weight <- function(range = c(-10, 0), trans = transform_log10()) {
new_quant_param(
type = "double",
range = range,
Expand Down
2 changes: 1 addition & 1 deletion R/space_filling.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' penalty(),
#' epochs(),
#' activation(),
#' learn_rate(c(0, 1), trans = scales::log_trans()),
#' learn_rate(c(0, 1), trans = scales::transform_log()),
#' size = 10,
#' original = FALSE
#' )
Expand Down
2 changes: 1 addition & 1 deletion man/Laplace.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/adjust_deg_free.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/bart-param.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/c5_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/class_weights.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/conditional_min_criterion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/cost.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/cubist_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/deg_free.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/degree.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dist_power.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dropout.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/earth_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading