deephyper.skopt.space.space.Real#

class deephyper.skopt.space.space.Real(low, high, prior='uniform', base=10, transform=None, name=None, dtype=<class 'float'>, loc=None, scale=None)[source]#

Bases: Dimension

Search space dimension that can take on any real value.

Parameters:
  • low (float) – Lower bound (inclusive).

  • high (float) – Upper bound (inclusive).

  • prior ("uniform" or "log-uniform", default="uniform") –

    Distribution to use when sampling random points for this dimension.

    • If “uniform”, points are sampled uniformly between the lower and upper bounds.

    • If “log-uniform”, points are sampled uniformly between log(lower, base) and log(upper, base) where log has base base.

  • base (int) – The logarithmic base to use for a log-uniform prior. - Default 10, otherwise commonly 2.

  • transform ("identity", "normalize", optional) –

    The following transformations are supported.

    • ”identity”, (default) the transformed space is the same as the original space.

    • ”normalize”, the transformed space is scaled to be between 0 and 1.

  • name (str or None) – Name associated with the dimension, e.g., “learning rate”.

  • dtype (str or dtype, default=float) – float type which will be used in inverse_transform, can be float.

Methods

distance

Compute distance between point a and b.

inverse_transform

Inverse transform samples from the warped space back into the original space.

rvs

Draw random samples.

set_transformer

Define rvs and transformer spaces.

transform

Transform samples form the original space to a warped space.

update_prior

Fit a Kernel Density Estimator to the data to increase density of samples around regions of interest instead of uniform random-sampling.

Attributes

bounds

Bounds before the transform/preprocessing.

is_constant

Tet if the dimension is constant.

name

Name of the dimension.

prior

size

Dimensionality of sampel from the dimension before the transform/preprocessing.

transformed_bounds

Bounds after the transform/preprocessing.

transformed_size

Dimensionality of samples from the dimension after the transform/preprocessing.

property bounds#

Bounds before the transform/preprocessing.

distance(a, b)[source]#

Compute distance between point a and b.

Args: a : float

First point.

bfloat

Second point.

inverse_transform(Xt)[source]#

Inverse transform samples from the warped space back into the original space.

property is_constant#

Tet if the dimension is constant.

property name#

Name of the dimension.

rvs(n_samples=1, random_state=None)[source]#

Draw random samples.

Parameters:
  • n_samples – int or None The number of samples to be drawn.

  • random_state – int, RandomState instance, or None (default) Set random state to something other than None for reproducible results.

set_transformer(transform='identity')[source]#

Define rvs and transformer spaces.

Args: transform : str

Can be ‘normalize’ or ‘identity’

property size#

Dimensionality of sampel from the dimension before the transform/preprocessing.

transform(X)#

Transform samples form the original space to a warped space.

property transformed_bounds#

Bounds after the transform/preprocessing.

property transformed_size#

Dimensionality of samples from the dimension after the transform/preprocessing.

update_prior(X, y, q=0.9)[source]#

Fit a Kernel Density Estimator to the data to increase density of samples around regions of interest instead of uniform random-sampling.