romcomma.gsa.models.GSA§
- class GSA(gp, kind, m=-1, is_error_calculated=False, **kwargs)[source]§
Bases:
Model
Class encapsulating a generic Sobol calculation.
- __init__(gp, kind, m=-1, is_error_calculated=False, **kwargs)[source]§
Perform a general GSA. The object created is single use and disposable: the constructor performs and records the entire GSA and the constructed object is basically useless once constructed.
- Parameters:
gp (GPR) – The underlying Gaussian Process.
kind (Kind) – The kind of index to calculate - first order, closed or total.
m (int) – The final index of the reduced model. For a single calculation it is required that
0 &le m < gp.M
. Any m outside this range results the Sobol index of kind being calculated for allm in range(1, M+1)
.is_error_calculated (bool) – Whether to calculate the standard error on the Sobol index. This is a memory intensive calculation, so leave this flag False unless you are sure you need errors
**kwargs (Any) – The calculation meta to override META.
Methods
__init__
(gp, kind[, m, is_error_calculated])Perform a general GSA.
calibrate
([method])Perform a generic GSA calculation.
read_meta
()write_meta
(meta)Attributes
ALL_KINDS
The object to do the calculations, whose marginalise(m) method returns a dict of results.
data
folder
- abstract property calibrator: Calibrator§
The object to do the calculations, whose marginalise(m) method returns a dict of results.
- calibrate(method=None, **kwargs)[source]§
Perform a generic GSA calculation. This method should be overriden by specific subclasses, and called via
super()
as a matter of priority.- Parameters:
method (str | None) – Not used.
- Return type:
Dict[str, Any]
Returns: The results of the calculation, as a labelled dictionary of tf.Tensors.
- class Data(folder, **kwargs)§
Bases:
Data
This is a placeholder which must be overridden in any implementation.
- Parameters:
folder (Path | str) –
kwargs (Data.Matrix) –
- class NamedTuple(NotImplemented=array([['NotImplemented']], dtype='<U14'))§
Bases:
NamedTuple
A NamedTuple of data. Must be overridden.
- count(value, /)§
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)§
Return first index of value.
Raises ValueError if the value is not present.
- static copy(src_folder, dst_folder)§
Returns a copy of
src_folder
at dst_folder, deleting anything existing at the destination.- Parameters:
src_folder (Path | str) –
dst_folder (Path | str) –
- Return type:
Path
- static delete(folder)§
Returns a non-existent
folder
.- Parameters:
folder (Path | str) –
- Return type:
Path
- static empty(folder)§
Returns an empty
folder
.- Parameters:
folder (Path | str) –
- Return type:
Path
- move(dst_folder)§
Move
self
todst_folder
.- Parameters:
dst_folder (Path | str) – The folder to move to. If this exists, it will be emptied.
- Return type:
Returns:
self
for chaining calls.
- classmethod read(folder, **kwargs)§
Read
Data
fromfolder
.- Parameters:
- Return type:
Returns: The
Data
stored infolder
.
- META = None§