sampling.mm.bestlh

sampling.mm.bestlh(
    n,
    k,
    population,
    iterations,
    p=1,
    plot=False,
    verbosity=0,
    edges=0,
    q_list=[1, 2, 5, 10, 20, 50, 100],
)

Generates an optimized Latin hypercube by evolving the Morris-Mitchell criterion across multiple exponents (q values) and selecting the best plan.

Parameters

Name Type Description Default
n int Number of points required in the Latin hypercube. required
k int Number of design variables (dimensions). required
population int Number of offspring in each generation of the evolutionary search. required
iterations int Number of generations for the evolutionary search. required
p int The distance norm to use. p=1 for Manhattan (L1), p=2 for Euclidean (L2). Defaults to 1 (faster than 2). 1
plot bool If True, a scatter plot of the optimized plan in the first two dimensions will be displayed. Only if k>=2. Defaults to False. False
verbosity int Verbosity level. 0 is silent, 1 prints the best q value found. Defaults to 0. 0
edges int If 1, places centers of the extreme bins at the domain edges ([0,1]). Otherwise, bins are fully contained within the domain, i.e. midpoints. Defaults to 0. 0
q_list list A list of q values to optimize. Defaults to [1, 2, 5, 10, 20, 50, 100]. These values are used to evaluate the space-fillingness of the Latin hypercube. The best plan is selected based on the lowest mmphi value. [1, 2, 5, 10, 20, 50, 100]

Returns

Name Type Description
np.ndarray np.ndarray: A 2D array of shape (n, k) representing an optimized Latin hypercube.

Examples

>>> import numpy as np
>>> from spotoptim.sampling.mm import bestlh
# Generate a 5-point, 2-dimensional Latin hypercube
>>> X = bestlh(n=5, k=2, population=5, iterations=10)
>>> print(X.shape)
(5, 2)