DataFeature¶
-
class
uncertainpy.
DataFeature
(name, evaluations=None, time=None, mean=None, variance=None, percentile_5=None, percentile_95=None, sobol_first=None, sobol_first_average=None, sobol_total=None, sobol_total_average=None, labels=[])[source]¶ Store the results of each statistical metric calculated from the uncertainty quantification and sensitivity analysis for a single model/feature.
The statistical metrics can be retrieved as attributes. Additionally, DataFeature implements all standard dictionary methods, such as items, value, contains and so implemented. This means it can be indexed as a regular dictionary with the statistical metric names as keys and returns the values for that statistical metric.
Parameters: - name (str) – Name of the model/feature.
- evaluations ({None, array_like}, optional.) – Feature or model result. Default is None.
- time ({None, array_like}, optional.) – Time evaluations for feature or model. Default is None.
- mean ({None, array_like}, optional.) – Mean of the feature or model results. Default is None.
- variance ({None, array_like}, optional.) – Variance of the feature or model results. Default is None.
- percentile_5 ({None, array_like}, optional.) – 5 percentile of the feature or model results. Default is None.
- percentile_95 ({None, array_like}, optional.) – 95 percentile of the feature or model results. Default is None.
- sobol_first ({None, array_like}, optional.) – First order sensitivity of the feature or model results. Default is None.
- sobol_first_average ({None, array_like}, optional.) – First order sensitivity of the feature or model results. Default is None.
- sobol_total ({None, array_like}, optional.) – Total effect sensitivity of the feature or model results. Default is None.
- sobol_total_average ({None, array_like}, optional.) – Average of the total effect sensitivity of the feature or model results. Default is None.
- labels (list, optional.) – A list of labels for plotting,
[x-axis, y-axis, z-axis]
Default is[]
.
Variables: - name (str) – Name of the model/feature.
- evaluations ({None, array_like}) – Feature or model output.
- time ({None, array_like}) – Time values for feature or model.
- mean ({None, array_like}) – Mean of the feature or model results.
- variance ({None, array_like}) – Variance of the feature or model results.
- percentile_5 ({None, array_like}) – 5 percentile of the feature or model results.
- percentile_95 ({None, array_like}) – 95 percentile of the feature or model results.
- sobol_first ({None, array_like}) – First order Sobol indices (sensitivity) of the feature or model results.
- sobol_first_average ({None, array_like}) – Average of the first order Sobol indices of the feature or model results.
- sobol_total ({None, array_like}) – Total order Sobol indices (sensitivity) of the feature or model results.
- sobol_total_average ({None, array_like}) – Average of the total order Sobol indices of the feature or model results.
- labels (list) – A list of labels for plotting,
[x-axis, y-axis, z-axis]
.
Notes
The statistical metrics calculated in Uncertainpy are:
evaluations
- the results from the model/feature evaluations.time
- the time of the model/feature.mean
- the mean of the model/feature.variance
. - the variance of the model/feature.percentile_5
- the 5th percentile of the model/feature.percentile_95
- the 95th percentile of the model/feature.sobol_first
- the first order Sobol indices (sensitivity) of the model/feature.sobol_first_average
- the average of the first order Sobol indices (sensitivity) of the model/feature.sobol_total
- the total order Sobol indices (sensitivity) of the model/feature.sobol_total_average
- the average of the total order Sobol indices (sensitivity) of the model/feature.
-
__delitem__
(statistical_metric)[source]¶ Delete data for statistical_metric (set to None).
Parameters: statistical_metric (str) – Name of the statistical metric.
-
__getitem__
(statistical_metric)[source]¶ Get the data for statistical_metric.
Parameters: statistical_metric (str) – Name of the statistical metric. Returns: The data for statistical_metric. Return type: {array_like, None}
-
__iter__
()[source]¶ Iterate over each statistical metric with data.
Yields: str – Name of the statistical metric.
-
__len__
()[source]¶ Get the number of data types with data.
Returns: The number of data types with data. Return type: int
-
__setitem__
(statistical_metric, data)[source]¶ Set the data for the statistical metric.
Parameters: - statistical_metric (str) – Name of the statistical metric.
- data ({array_like, None}) – The data for the statistical metric.
-
clear
() → None. Remove all items from D.¶
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
get_metrics
()[source]¶ Get the names of all statistical metrics that contain data (not None).
Returns: List of the names of all statistical metric that contain data. Return type: list
-
items
() → list of D's (key, value) pairs, as 2-tuples¶
-
iteritems
() → an iterator over the (key, value) items of D¶
-
iterkeys
() → an iterator over the keys of D¶
-
itervalues
() → an iterator over the values of D¶
-
keys
() → list of D's keys¶
-
ndim
()[source]¶ Get the number of dimensions the data of a data type. Returns None if no evaluations or all evaluations contain numpy.nan.
Parameters: feature (str) – Name of the model or a feature. Returns: The number of dimensions of the data of the data type. Return type: int
-
pop
(k[, d]) → v, remove specified key and return the corresponding value.¶ If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), remove and return some (key, value) pair¶ as a 2-tuple; but raise KeyError if D is empty.
-
setdefault
(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of D's values¶