Experiment¶
- class Experiment(*args)¶
Base class for design of experiments.
Considering a vector of input parameters, this class is used to determine a particular set of values of according to a particular design of experiments.
Different types of design of experiments can be determined:
some stratified patterns: axial, composite, factorial or box patterns,
some weighted patterns that we can split into different categories: random patterns, low discrepancy sequences and deterministic patterns.
See also
Examples
Define a custom design of experiment:
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> class RandomExp(object): ... def generate(self): ... return ot.Normal(1).getSample(10) >>> experiment = ot.Experiment(RandomExp()) >>> sample = experiment.generate()
Methods
generate
()Generate points according to the type of the experiment.
Accessor to the object's name.
getId
()Accessor to the object's id.
Accessor to the underlying implementation.
getName
()Accessor to the object's name.
setName
(name)Accessor to the object's name.
- __init__(*args)¶
- generate()¶
Generate points according to the type of the experiment.
- Returns
- sample
Sample
The points which constitute the design of experiments. The sampling method is defined by the nature of the experiment.
- sample
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> myExperiment = ot.Experiment(ot.MonteCarloExperiment(ot.Normal(2),5)) >>> print(myExperiment.generate()) [ X0 X1 ] 0 : [ 0.608202 -1.26617 ] 1 : [ -0.438266 1.20548 ] 2 : [ -2.18139 0.350042 ] 3 : [ -0.355007 1.43725 ] 4 : [ 0.810668 0.793156 ]
- getClassName()¶
Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
- getId()¶
Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
- getImplementation()¶
Accessor to the underlying implementation.
- Returns
- implImplementation
A copy of the underlying implementation object.
- getName()¶
Accessor to the object’s name.
- Returns
- namestr
The name of the object.
- setName(name)¶
Accessor to the object’s name.
- Parameters
- namestr
The name of the object.