deephyper.skopt.sampler.Lhs#

class deephyper.skopt.sampler.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.

Parameters:
  • 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_samples (int) – The order of the LHS sequence. Defines the number of samples.

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

Returns:

LHS set

Return type:

np.array, shape=(n_dim, n_samples)

set_params(**params)#

Set the parameters of this initial point generator.

Parameters:

**params (dict) – Generator parameters.

Returns:

self – Generator instance.

Return type:

object