rc.task.scripts§
User interface to GPR, GSA and ROM
Methods§
Module Contents§
- gpr(name, repo, is_read, is_covariant, is_isotropic, ignore_exceptions=False, kernel_parameters=None, likelihood_variance=None, is_calibrated=True, is_tested=True, **kwargs)§
Undertake GPR on a Fold, or recursively across the Folds in a Repo.
- Parameters:
name (str) – The MOGP name.
repo (Repo) – A Fold to house the MOGP, or a Repo containing Folds to house the GPs.
is_read (bool | None) – If True, MOGP kernel data and likelihood_variance are read from
fold.folder/name
, otherwise defaults are used. If None, the nearest ancestor MOGP in the independence/isotropy hierarchy is recursively constructed from its nearest ancestor MOGP if necessary, then read and broadcast available.is_covariant (bool | None) – Whether the outputs are independent of each other or not. If None, independent is task then broadcast to task dependent.
is_isotropic (bool | None) – Whether the kernel is isotropic. If None, isotropic is task, then broadcast to task anisotropic.
ignore_exceptions (bool) – Whether to continue when the MOGP provider throws an exception.
kernel_parameters (Data | None) – If not None, this replaces the Kernel specified by the MOGP default.
likelihood_variance (NP.Matrix | None) – If not None this replaces the likelihood_variance specified by the MOGP default.
is_calibrated (bool) – Whether to is_calibrated each MOGP.
is_tested (bool) – Whether to test_data each MOGP.
kwargs – A Dict of implementation-dependent passes straight to MOGP.Optimize().
- Returns:
A list of the names of the GPs which have been constructed. The MOGP.Data are
task.results.Aggregated
over folds- Raises:
FileNotFoundError – If repo is not a Fold, and contains no Folds.
- Return type:
rc.base.definitions.List[str]
- gsa(name, repo, is_covariant, is_isotropic, kinds=GSA.ALL_KINDS, m=-1, ignore_exceptions=False, is_error_calculated=False, **kwargs)§
Undertake GSA on a Fold, or recursively across the Folds in a Repo.
- Parameters:
name (str) – The GSA name.
repo (Repo) – A Fold to house the GSA, or a Repo containing Folds to house the GSAs.
is_covariant (rc.base.definitions.Optional[bool]) – Whether each output is independent of the other outputs. None results in variant (independent) followed by covariant (dependent).
is_isotropic (rc.base.definitions.Optional[bool]) – Whether the kernel is isotropic. If None, isotropic is task, then broadcast to task anisotropic.
kinds (Kind | rc.base.definitions.Sequence[Kind]) – Kind of index to calculate - first_order, closed or total. A Sequence of Kinds will be task consecutively.
is_error_calculated (bool) – Whether to calculate variances (errors) on the Sobol indices. The calculation of error is memory intensive, so leave this flag as False unless you are sure you need errors. Furthermore, errors will only be calculated if the kernel of the GP has diagonal variance F.
m (int) – The dimensionality of the reduced model. For a single calculation it is required that
0 < m < gp.M
. Any m outside this range results the Sobol index of each kind being calculated for allm in range(1, M+1)
.ignore_exceptions (bool) – Whether to ignore exceptions (e.g. file not found) when they are encountered, or halt.
kwargs – A Dict of gsa calculation options, which updates the default gsa.undertake.calculation.META.
- Raises:
FileNotFoundError – If repo is not a Fold, and contains no Folds.
- Returns:
A list of the calculation names which have been task, relative to repo.folder.
- Return type:
rc.base.definitions.List[rc.base.definitions.Path]