deephyper.skopt.sampler.lhs.Lhs

deephyper.skopt.sampler.lhs.Lhs#

class deephyper.skopt.sampler.lhs.Lhs(lhs_type='classic', criterion='maximin', iterations=1000)[source]#

Bases: InitialPointGenerator

Latin hypercube sampling

Parameters:
  • lhs_type (str, default='classic') –

    • ‘classic’ - a small random number is added

    • ’centered’ - points are set uniformly in each interval

  • criterion (str or None, default='maximin') –

    When set to None, the LHS is not optimized

    • ’correlation’ : optimized LHS by minimizing the correlation

    • ’maximin’ : optimized LHS by maximizing the minimal pdist

    • ’ratio’ : optimized LHS by minimizing the ratio max(pdist) / min(pdist)

  • iterations (int) – Defines the number of iterations for optimizing LHS

Methods

generate

Creates latin hypercube samples.

set_params

Set the parameters of this initial point generator.

generate(dimensions, n_samples, random_state=None)[source]#

Creates latin hypercube samples.

Args: dimensions : list, shape (n_dims,)

List of search space dimensions. Each search dimension can be defined either as

  • a (lower_bound, upper_bound) tuple (for Real or Integer dimensions),

  • a (lower_bound, upper_bound, “prior”) tuple (for Real dimensions),

  • as a list of categories (for Categorical dimensions), or

  • an instance of a Dimension object (Real, Integer or Categorical).

n_samplesint

The order of the LHS sequence. Defines the number of samples.

random_stateint, RandomState instance, or None (default)

Set random state to something other than None for reproducible results.

Returns: np.array, shape=(n_dim, n_samples)

LHS set

set_params(**params)#

Set the parameters of this initial point generator.

Args: **params : dict

Generator parameters.

Returns: self : object

Generator instance.