Skip to content
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
22 changes: 18 additions & 4 deletions R/parameters.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#' Information on tuning parameters within an object
#' Create a parameter set
#'
#' @param x An object, such as a list of `param` objects or an actual `param`
#' object.
#' object.
#' @param ... Only used for the `param` method so that multiple `param` objects
#' can be passed to the function.
#' can be passed to the function.
#'
#' @return
#' A parameter set of class `parameters` in the form of a data frame where each
#' row represents one tunable parameter.
#'
#' @seealso [dials::update.parameters()], [dials::finalize()],
#' [hardhat::extract_parameter_set_dials()]
#'
#' @examples
#' params <- list(lambda = penalty(), alpha = mixture(), `rand forest` = mtry())
#' pset <- parameters(params)
#' pset
#'
#' @export
parameters <- function(x, ...) {
UseMethod("parameters")
Expand Down Expand Up @@ -177,12 +190,13 @@ print.parameters <- function(x, ...) {
print_x$object <-
purrr::map_chr(
print_x$object,
\(.x)
\(.x) {
if (all(is.na(.x))) {
"missing"
} else {
pillar::type_sum(.x)
}
}
)

cli::cli_par()
Expand Down
18 changes: 16 additions & 2 deletions man/parameters.Rd

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