deephyper.problem.OrdinalHyperparameter#

class deephyper.problem.OrdinalHyperparameter#

Bases: ConfigSpace.hyperparameters.Hyperparameter

Methods

allow_greater_less_comparison

check_default

check if given default value is represented in the sequence.

check_order

check whether value1 is smaller than value2.

compare

compare_vector

get_max_density

get_neighbors

Return the neighbors of a given value.

get_num_neighbors

return the number of existing neighbors in the sequence

get_order

return the seuence position/order of a certain value from the sequence

get_seq_order

return the ordinal sequence as numeric sequence (according to the the ordering) from 1 to length of our sequence.

get_size

get_value

return the sequence value of a given order/position

has_neighbors

check if there are neighbors or we’re only dealing with an one-element sequence

is_legal

check if a certain value is represented in the sequence

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 original 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

Attributes

default_value

meta

name

normalized_default_value

num_elements

sequence

check_default()#

check if given default value is represented in the sequence. If there’s no default value we simply choose the first element in our sequence as default.

check_order()#

check whether value1 is smaller than value2.

get_neighbors()#

Return the neighbors of a given value. Value must be in vector form. Ordinal name will not work.

get_num_neighbors()#

return the number of existing neighbors in the sequence

get_order()#

return the seuence position/order of a certain value from the sequence

get_seq_order()#

return the ordinal sequence as numeric sequence (according to the the ordering) from 1 to length of our sequence.

get_value()#

return the sequence value of a given order/position

has_neighbors()#

check if there are neighbors or we’re only dealing with an one-element sequence

check if a certain value is represented in the sequence

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 original hyperparameter space (the one specified by the user). For each parameter 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. The OrdinalHyperparameter is treated as a UniformHyperparameter with regard to its probability density.

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.