DOE algorithms

In this example, we will discover the different functions of the API related to design of experiments.

from __future__ import division, unicode_literals

from gemseo.api import (
    configure_logger,
    get_algorithm_options_schema,
    get_available_doe_algorithms,
)

configure_logger()

Out:

<RootLogger root (INFO)>

Get available DOE algorithms

The get_available_doe_algorithms() function returns the list of optimization algorithms available in GEMSEO or in external modules

print(get_available_doe_algorithms())

Out:

['CustomDOE', 'DiagonalDOE', 'OT_SOBOL', 'OT_HASELGROVE', 'OT_REVERSE_HALTON', 'OT_HALTON', 'OT_FAURE', 'OT_AXIAL', 'OT_FACTORIAL', 'OT_MONTE_CARLO', 'OT_LHS', 'OT_LHSC', 'OT_OPT_LHS', 'OT_RANDOM', 'OT_FULLFACT', 'OT_COMPOSITE', 'OT_SOBOL_INDICES', 'fullfact', 'ff2n', 'pbdesign', 'bbdesign', 'ccdesign', 'lhs']

Get options schema

For a given optimization algorithm, e.g. "DiagonalDOE", we can get the options; e.g.

print(get_algorithm_options_schema("DiagonalDOE"))

Out:

{'$schema': 'http://json-schema.org/draft-04/schema', 'description': 'Diagonal DOE algorithm', 'additionalProperties': False, 'type': 'object', 'properties': {'eval_jac': {'description': 'evaluate jacobian :type eval_jac: bool', 'type': 'boolean'}, 'n_processes': {'minimum': 1, 'description': 'number of processes :type n_processes: int', 'type': 'integer'}, 'wait_time_between_samples': {'minimum': 0, 'description': 'waiting time between two samples :type wait_time_between_samples: float', 'type': 'number'}, 'n_samples': {'minimum': 1, 'description': 'number of samples :type n_samples: int', 'type': 'integer'}, 'max_time': {'minimum': 0.0, 'description': 'maximum runtime in seconds, disabled if 0 (Default value = 0) :type max_time: float', 'type': 'number'}, 'reverse': {'description': 'list of dimensions or variables to sample from their upper bounds to their lower bounds. Default: None. :type reverse: list(str)', 'type': 'array', 'items': {'minItems': 1, 'type': 'string'}}}}

Total running time of the script: ( 0 minutes 0.003 seconds)

Gallery generated by Sphinx-Gallery