Learn R Programming

dynparam (version 1.0.2)

parameter_set: Parameter set helper functions

Description

Parameter set helper functions

Usage

parameter_set(..., parameters = NULL, forbidden = NULL)

is_parameter_set(x)

# S3 method for parameter_set as.list(x, ...)

as_parameter_set(li)

get_defaults(x)

sip(x, n = 1, as_tibble = TRUE)

as_paramhelper(x)

Arguments

...

Parameters to wrap in a parameter set.

parameters

A list of parameters to wrap in a parameter set.

forbidden

States forbidden region of parameter via a character vector, which will be turned into an expression.

x

An object for which to check whether it is a parameter set.

li

A list to be converted into a parameter set.

n

Number of objects to return.

as_tibble

Whether or not to return as a tibble.

Parameter set instatiations

  • get_defaults(): Get all default parameters.

  • sip(): It's like sample(), but for parameter sets.

  • as_paramhelper(): Convert a parameter set to a ParamHelpers object.

Serialisation

  • as.list(): Converting a parameter set to a list.

  • as_parameter_set(): Converting a list back to a parameter set.

  • is_parameter_set(x): Checking whether something is a parameter set.

See Also

dynparam for an overview of all dynparam functionality.

Examples

Run this code
# NOT RUN {
parameters <- parameter_set(
  integer_parameter(
    id = "num_iter",
    default = 100L,
    distribution = expuniform_distribution(lower = 1L, upper = 10000L),
    description = "Number of iterations"
  ),
  subset_parameter(
    id = "dimreds",
    default = c("pca", "mds"),
    values = c("pca", "mds", "tsne", "umap", "ica"),
    description = "Which dimensionality reduction methods to apply (can be multiple)"
  ),
  integer_range_parameter(
    id = "ks",
    default = c(3L, 15L),
    lower_distribution = uniform_distribution(1L, 5L),
    upper_distribution = uniform_distribution(10L, 20L),
    description = "The numbers of clusters to be evaluated"
  )
)

get_defaults(parameters)

sip(parameters, n = 1)
# }

Run the code above in your browser using DataLab