matflow.param_classes.surrogate.Surrogate#
- class matflow.param_classes.surrogate.Surrogate(X, y, parameter_names=None, model=None, scale=True)#
Bases:
ParameterValueMethods
Write a list (from an element group) of parameter values to an HDF5 group.
Write this parameter value to an HDF5 group.
Wrapper function for scipy.stats.sobol_indices
Prepare this parameter value for serialisation as JSON.
Extract a parameter value from an HDF5 group.
Extract a parameter value from JSON data.
Convert to a serialisable dictionary.
Attributes
Path to the c++ compiler that Pytensor should use.
- build_model(kernel='matern', cross_validate=False, cross_validator=5, scoring='neg_mean_absolute_error', **kwargs)#
- classmethod dump_element_group_to_HDF5_group(objs, group)#
Write a list (from an element group) of parameter values to an HDF5 group.
- Parameters:
objs (list[Self]) –
group (HDF5Group) –
- dump_to_HDF5_group(group)#
Write this parameter value to an HDF5 group.
- Parameters:
group (HDF5Group) –
- fit(Y_actual, Y_error, use_std=True, **kwargs)#
- generate_sobol(use_fit=False, **kwargs)#
Wrapper function for scipy.stats.sobol_indices
- Parameters:
n (int) – number of samples
**kwargs – additonal parameters
- Returns:
SobolResult
- Return type:
sobol
- get_unscaled_data(unscale_X=True, unscale_y=True)#
- make_prediction(X, return_std=False, scalar_output=False)#
- make_prediction_sobol(X)#
- perform_inference(Y_actual, Y_error, initval=None, use_std=True, **kwargs)#
- prepare_JSON_dump()#
Prepare this parameter value for serialisation as JSON.
- pytensor_config_cxx: ClassVar[str | None] = None#
Path to the c++ compiler that Pytensor should use. If setting, this should be done before an instance is created.
- classmethod save_from_HDF5_group(group, param_id, workflow)#
Extract a parameter value from an HDF5 group.
- classmethod save_from_JSON(data, param_id, workflow)#
Extract a parameter value from JSON data.
- scale_data(scale_X=True, scale_y=True)#
- to_dict()#
Convert to a serialisable dictionary.