Sampling methods for design of experiments in Python. pysampling generates
well-spread point sets in the unit hypercube [0, 1]^d and provides a suite of
measures to assess their uniformity.
Detailed documentation: https://anyoptimization.com/projects/pysampling
| Key | Method |
|---|---|
random |
Uniform random sampling |
lhs |
Latin Hypercube Sampling |
halton |
Halton sequence |
sobol |
Sobol sequence |
riesz |
Riesz s-energy (maximin) |
pip install -U pysamplingImport the sample function and pick an algorithm. Here we draw 50 points in 2
dimensions with Latin Hypercube Sampling:
from pysampling.sample import sample
X = sample("lhs", 50, 2)To visualize the result (requires the optional plot extra, pip install pysampling[plot]):
import matplotlib.pyplot as plt
plt.scatter(X[:, 0], X[:, 1], s=30, facecolors="none", edgecolors="r")
plt.show()See examples/plot_sampling.py for a runnable demo.
This project uses pyclawd as its dev toolkit.
pip install -e . --group dev
pyclawd check # format-check -> lint -> typecheck -> test
pyclawd test fast # quick test runThe docs are built by a cached pipeline (see docs/):
pip install -e . --group docs # one-time: install the docs toolchain
pyclawd docs build # compile -> execute (cached) -> render HTML
pyclawd docs serve # serve docs/build/html locallyJulian Blank — blankjul@outlook.com
Apache License 2.0 — see LICENSE.