skopt.sampler.Lhs

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

Latin hypercube sampling

Parameters
lhs_typestr, default=’classic’
  • ‘classic’ - a small random number is added

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

criterionstr 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)

iterationsint

Defines the number of iterations for optimizing LHS

Methods

generate(dimensions, n_samples[, random_state])

Creates latin hypercube samples.

set_params(**params)

Set the parameters of this initial point generator.

__init__(lhs_type='classic', criterion='maximin', iterations=1000)[source][source]

Initialize self. See help(type(self)) for accurate signature.

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

Creates latin hypercube samples.

Parameters
dimensionslist, 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)[source]

Set the parameters of this initial point generator.

Parameters
**paramsdict

Generator parameters.

Returns
——-
selfobject

Generator instance.