Design of Experiments¶
mixle.doe covers the design and analysis loop around expensive black-box
functions. It is useful when you cannot evaluate every input, labels are
expensive, simulation is slow, or you need to quantify how inputs drive model
outputs.
The package is organized around four phases:
generate an initial design;
fit or query a surrogate;
choose follow-up points by acquisition, information gain, or active learning;
analyze sensitivity, uncertainty propagation, or calibration.
Design Generators¶
Design generators return NumPy arrays scaled to supplied bounds.
from mixle.doe import latin_hypercube, sobol_design
bounds = [(0.0, 1.0), (-2.0, 2.0)]
x_lhs = latin_hypercube(bounds, n=16, seed=0)
x_sobol = sobol_design(bounds, n=32)
Available generators include:
random designs;
Latin hypercube and maximin Latin hypercube;
Sobol and Halton sequences;
MaxPro designs;
full factorial, fractional factorial, and Plackett-Burman designs;
central composite and Box-Behnken response-surface designs;
simplex lattice and simplex centroid mixture designs;
optimal designs under D, A, I, G, E, and c criteria.
Design Diagnostics¶
Use diagnostics before spending an expensive run budget:
from mixle.doe import design_diagnostics
report = design_diagnostics(x_lhs)
print(report)
Diagnostics help compare coverage, spacing, and projection behavior across candidate designs.
Bayesian Optimization¶
The Bayesian optimization layer provides standard single-point acquisitions and batch/high-dimensional variants.
from mixle.doe import minimize
def objective(x):
return expensive_simulator(x)
result = minimize(
objective,
bounds=[(0.0, 1.0), (-2.0, 2.0)],
n_init=8,
n_iter=24,
seed=0,
)
print(result.x_best, result.y_best)
Acquisition functions include expected improvement, log expected improvement, probability of improvement, upper confidence bound, Thompson sampling, and knowledge gradient. Advanced routes include Monte-Carlo q-EI, local penalization, max-value entropy search, trust-region BO, constrained BO, multi-objective BO, and multi-fidelity BO.
Active Learning¶
Active learning chooses points that most improve a surrogate or parameter estimate.
from mixle.doe import active_learning_design
design = active_learning_design(
initial_x,
initial_y,
bounds=[(0.0, 1.0), (-2.0, 2.0)],
n_iter=10,
)
Lower-level scoring functions include alm_scores, alc_scores,
expected_information_gain_linear, and expected_information_gain_nmc.
Sensitivity Analysis¶
Sensitivity tools quantify which inputs matter.
from mixle.doe import morris_screening, sobol_indices
morris = morris_screening(model_fn, bounds, n_trajectories=20, seed=0)
sobol = sobol_indices(model_fn, bounds, n=1024, seed=0)
Use Morris screening for a cheaper qualitative pass and Sobol indices when you need variance-based main and interaction effects.
Uncertainty Propagation and Calibration¶
propagate and unscented_transform push input uncertainty through a
model. calibrate implements Kennedy-O’Hagan style calibration to field data.
from mixle.doe import propagate, unscented_transform
propagated = propagate(model_fn, input_distribution, n=1000, seed=0)
approx = unscented_transform(model_fn, mean, cov)
How DOE Connects to Task Distillation¶
mixle.task uses the same design philosophy for label acquisition. Active
distillation treats teacher calls as an expensive experiment and spends the
label budget on informative examples. Use Task Distillation for the
task-facing workflow.
API Map¶
Area |
Key imports |
|---|---|
Space-filling designs |
|
Classical designs |
|
Response-surface designs |
|
Mixture designs |
|
Optimal design |
|
Bayesian optimization |
|
Advanced BO |
|
Active learning |
|
Analysis |
|
Detailed API Inventory¶
Area |
Imports |
|---|---|
Bounds and random designs |
|
Factorial analysis |
|
Response surfaces |
|
Acquisition functions |
|
Acquisition registry |
|
Optimal-design criteria |
|
Constrained BO |
|
Multi-objective and batch BO |
|
Entropy and trust-region BO |
|
Multi-fidelity and sensitivity |
|
Propagation and calibration |
|