Learn R Programming

comparer (version 0.2.4)

R6_par_unordered: R6 class for hyperparameter of discrete (factor) variable

Description

R6 class for hyperparameter of discrete (factor) variable

R6 class for hyperparameter of discrete (factor) variable

Arguments

Super class

comparer::par_hype -> par_unordered

Public fields

name

Name of the parameter, must match the input to `eval_func`.

values

Vector of values

ggtrans

Transformation for ggplot, see ggplot2::scale_x_continuous()

lower

Lower bound of the parameter

upper

Upper bound of the parameter

Methods


Method fromraw()

Function to convert from raw scale to transformed scale

Usage

R6_par_unordered$fromraw(x)

Arguments

x

Value of raw scale


Method toraw()

Function to convert from transformed scale to raw scale

Usage

R6_par_unordered$toraw(x)

Arguments

x

Value of transformed scale


Method fromint()

Convert from integer index to actual value

Usage

R6_par_unordered$fromint(x)

Arguments

x

Integer index


Method toint()

Convert from value to integer index

Usage

R6_par_unordered$toint(x)

Arguments

x

Value


Method generate()

Generate values in the raw space based on quantiles.

Usage

R6_par_unordered$generate(q)

Arguments

q

In [0,1].


Method getseq()

Get a sequence, uniform on the transformed scale

Usage

R6_par_unordered$getseq(n)

Arguments

n

Number of points. Ignored for discrete.


Method isvalid()

Check if input is valid for parameter

Usage

R6_par_unordered$isvalid(x)

Arguments

x

Parameter value


Method convert_to_mopar()

Convert this to a parameter for the mixopt R package.

Usage

R6_par_unordered$convert_to_mopar(raw_scale = FALSE)

Arguments

raw_scale

Should it be on the raw scale?


Method new()

Create a hyperparameter with uniform distribution

Usage

R6_par_unordered$new(name, values)

Arguments

name

Name of the parameter, must match the input to `eval_func`.

values

The values the variable can take on.


Method print()

Print details of the object.

Usage

R6_par_unordered$print(...)

Arguments

...

not used


Method clone()

The objects of this class are cloneable with this method.

Usage

R6_par_unordered$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
p1 <- par_unordered('x1', c('a', 'b', 'c'))
class(p1)
print(p1)

Run the code above in your browser using DataLab