deephyper.problem.BetaIntegerHyperparameter#

class deephyper.problem.BetaIntegerHyperparameter#

Bases: ConfigSpace.hyperparameters.UniformIntegerHyperparameter

Methods

allow_greater_less_comparison

check_default

check_int

compare

compare_vector

get_max_density

Returns the maximal density on the pdf for the parameter (so not the mode, but the value of the pdf on the mode).

get_neighbors

Get the neighbors of a value

get_num_neighbors

get_size

has_neighbors

is_legal

is_legal_vector

Check whether the given value is a legal value for the vector representation of this hyperparameter.

pdf

Computes the probability density function of the hyperparameter in the hyperparameter space (the one specified by the user).

rvs

scipy compatibility wrapper for _sample, allowing the hyperparameter to be used in sklearn API hyperparameter searchers, eg.

sample

to_uniform

Attributes

alpha

beta

bfhp

default_value

log

lower

meta

name

normalized_default_value

q

upper

get_max_density()#

Returns the maximal density on the pdf for the parameter (so not the mode, but the value of the pdf on the mode).

get_neighbors()#

Get the neighbors of a value

Note

This assumes the value is in the unit-hypercube [0, 1]

Parameters
  • value (float) – The value to get neighbors around. This assume the value has been converted to the [0, 1] range which can be done with _inverse_transform.

  • rs (RandomState) – The random state to use

  • number (int = 4) – How many neighbors to get

  • transform (bool = False) – Whether to transform this value from the unit cube, back to the hyperparameter’s specified range of values.

  • std (float = 0.2) – The std. dev. to use in the [0, 1] hypercube space while sampling for neighbors.

Returns

Some number of neighbors centered around value.

Return type

List[int]

Check whether the given value is a legal value for the vector representation of this hyperparameter.

Parameters

value – the vector value to check

Returns

True if the given value is a legal vector value, otherwise False

Return type

bool

pdf()#

Computes the probability density function of the hyperparameter in the hyperparameter space (the one specified by the user). For each hyperparameter type, there is also a method _pdf which operates on the transformed (and possibly normalized) hyperparameter space. Only legal values return a positive probability density, otherwise zero.

Parameters

vector (np.ndarray) – the (N, ) vector of inputs for which the probability density function is to be computed.

Returns

Probability density values of the input vector

Return type

np.ndarray(N, )

rvs()#

scipy compatibility wrapper for _sample, allowing the hyperparameter to be used in sklearn API hyperparameter searchers, eg. GridSearchCV.