### 30 releases (breaking)

0.23.0 | Oct 1, 2024 |
---|---|

0.21.1 | Jul 30, 2024 |

0.16.0 | Mar 7, 2024 |

0.14.0 | Dec 13, 2023 |

0.4.0 | Jul 9, 2022 |

#**460** in Machine learning

**291** downloads per month

Used in **4** crates

**Apache-2.0**

32KB

605 lines

# Design of experiments

provides a Rust implementation of some design of experiments building methods.
It is a Rust port of sampling methods of the SMT Python library.`egobox-doe`

## The big picture

is a library crate in the top-level package egobox.`egobox-doe`

## Current state

currently provides an implementation of the following methods:`egobox-doe`

- Random sampling
- Full-factorial sampling
- Latin hypercube sampling: classic, centered, optimized

## Examples

There is an usage example in the examples/ directory. To run, use:

`$`` cargo run`` --`release` --`example samplings

## License

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0

###
`lib.rs`

:

This library implements some Design of Experiments (DoE) methods a.k.a. sampling methods, specially the Latin Hypercube sampling method which is used by surrogate-based methods. This library is a port of SMT sampling methods.

A DoE method is a way to generate a set of points (i.e. a DoE) within a design (or sample) space

.
The design space is defined as a 2D ndarray `xlimits`

, specifying lower bound and upper bound
of each `(`nx`,` `2``)`

components of the samples `nx`

.`x`

Example:

`use` `egobox_doe``::``{`FullFactorial`,` Lhs`,` LhsKind`,` Random`,` SamplingMethod`}``;`
`use` `ndarray``::``{`arr2`}``;`
`use` `ndarray_rand``::``rand``::`SeedableRng`;`
`use` `rand_xoshiro``::`Xoshiro256Plus`;`
`//` Design space is defined as [5., 10.] x [0., 1.], samples are 2-dimensional.
`let` xlimits `=` `arr2``(``&``[``[``5.``,` `10.``]``,` `[``0.``,` `1.``]``]``)``;`
`//` We generate five samples using centered Latin Hypercube sampling.
`let` samples `=` `Lhs``::`new`(``&`xlimits`)``.``kind``(``LhsKind``::`Centered`)``.``sample``(``5``)``;`
`//` or else with FullFactorial sampling
`let` samples `=` `FullFactorial``::`new`(``&`xlimits`)``.``sample``(``5``)``;`
`//` or else randomly with random generator for reproducibility
`let` samples `=` `Random``::`new`(``&`xlimits`)``.``with_rng``(``Xoshiro256Plus``::`seed_from_u64`(``42``)``)``.``sample``(``5``)``;`

This library contains three kinds of sampling methods:

#### Dependencies

~7MB

~140K SLoC