mixle.doe.designs module¶
Space-filling and classical experiment-design generators.
Every generator takes per-dimension bounds – a sequence of (low, high) pairs – and
returns a (n, d) numpy array of points scaled into those bounds. Random designs accept a
seed (int or numpy.random.RandomState) for reproducibility, matching the rest of mixle.
- random_design(bounds, n, seed=None)[source]
Return
niid uniform points overboundsas an(n, d)array.
- latin_hypercube(bounds, n, seed=None, *, center=False)[source]
Return an
n-point Latin hypercube design overbounds.Each of the
daxes is partitioned intonequal strata and exactly one sample falls in each stratum (the defining LHS property), with the per-axis stratum assignments independently permuted. Withcenter=Trueeach sample sits at its stratum midpoint; otherwise it is drawn uniformly within the stratum.
- maximin_latin_hypercube(bounds, n, seed=None, *, trials=32)[source]
Return the best of
trialsLatin hypercube designs by the maximin criterion.Generates
trialsindependent LHS designs and keeps the one whose minimum pairwise (Euclidean, bound-normalized) distance is largest, a simple way to improve space-fillingness.
- maxpro_design(bounds, n, seed=None, *, restarts=3, swaps=1500, maxiter=300)[source]
Return a maximum-projection (MaxPro) space-filling design (Joseph, Gul & Ba 2015).
MaxPro minimizes
sum_{i<j} 1 / prod_k (x_ik - x_jk)^2, which forces the points to spread out in every subspace projection, not just the full space – the design of choice when only some inputs turn out to matter (factor screening / sloppy models), since the points stay space-filling even projected onto the active subset.Built by the paper’s two-stage procedure, repeated from
restartsLatin-hypercube starts: (1) a MaxProLHD coordinate-exchange phase (swapswithin-column swaps) finds a good basin while keeping the LHS structure, then (2) continuous L-BFGS-B optimization (analytic gradient,maxitersteps) moves the points off the grid to the true MaxPro optimum – the refinement that cuts the criterion by far more than the swap phase alone. The best design over restarts is returned as an(n, d)array.
- sobol_design(bounds, n, seed=None, *, scramble=True)[source]
Return an
n-point Sobol’ low-discrepancy design overbounds.Sobol’ is a quasi-random sequence whose discrepancy (deviation from perfectly even coverage) is far lower than iid uniform sampling, so it fills the space more evenly for moderate
n.scramble=Trueapplies Owen scrambling, which randomizes the sequence reproducibly fromseedwhile preserving the low-discrepancy structure;scramble=Falsereturns the raw deterministic sequence. Balance properties are best whennis a power of two.
- halton_design(bounds, n, seed=None, *, scramble=True)[source]
Return an
n-point Halton low-discrepancy design overbounds.Halton is a quasi-random sequence (coprime van der Corput sequences per axis) that, like Sobol’, fills space more evenly than iid uniform sampling and works for any
n(no power-of-two preference).scramble=Truerandomizes it reproducibly fromseed.
- full_factorial(bounds, levels)[source]
Return a full-factorial grid design over
bounds.levelsis the number of evenly-spaced levels per dimension (a scalar applied to all dimensions, or one entry per dimension, each>= 1). The result hasprod(levels)rows in row-major (last axis fastest) order. A dimension with one level is placed at its midpoint.