ot_gpr module¶
Gaussian process regression model from OpenTURNS.
- class gemseo_mlearning.regression.ot_gpr.OTGaussianProcessRegressor(data, transformer=None, input_names=None, output_names=None, use_hmat=None, trend_type=TrendType.CONSTANT)[source]
Bases:
MLRegressionAlgoGaussian process regression model from OpenTURNS.
# noqa: D205 D212 D415
- Parameters:
data (Dataset) – The learning dataset.
transformer (TransformerType | None) – The strategies to transform the variables. The values are instances of
Transformerwhile the keys are the names of either the variables or the groups of variables, e.g."inputs"or"outputs"in the case of the regression algorithms. If a group is specified, theTransformerwill be applied to all the variables of this group. IfIDENTITY, do not transform the variables.input_names (Iterable[str]) – The names of the input variables. If
None, consider all the input variables of the learning dataset.output_names (Iterable[str]) – The names of the output variables. If
None, consider all the output variables of the learning dataset.use_hmat (bool) – Whether to use the HMAT or LAPACK as linear algebra method. If
None, use HMAT when the learning size is greater thanMAX_SIZE_FOR_LAPACK.trend_type (TrendType) –
The type of the trend.
By default it is set to “constant”.
- Raises:
ValueError – When both the variable and the group it belongs to have a transformer.
- class TrendType(value)[source]
Bases:
StrEnumThe trend type of the Gaussian process regressor.
- CONSTANT = 'constant'
- LINEAR = 'linear'
- QUADRATIC = 'quadratic'
- predict_std(input_data)[source]
Predict the standard deviation from input data.
- HMATRIX_ASSEMBLY_EPSILON: ClassVar[float] = 1e-05
The epsilon used for the assembly of the H-matrix.
Used when
use_hmatisTrue.
- HMATRIX_RECOMPRESSION_EPSILON: ClassVar[float] = 0.0001
The epsilon used for the recompression of the H-matrix.
Used when
use_hmatisTrue.
- LIBRARY: Final[str] = 'OpenTURNS'
The name of the library of the wrapped machine learning algorithm.
- MAX_SIZE_FOR_LAPACK: ClassVar[int] = 100
The maximum size of the learning dataset to use LAPACK as linear algebra library.
Use HMAT otherwise.
- SHORT_ALGO_NAME: ClassVar[str] = 'GPR'
The short name of the machine learning algorithm, often an acronym.
Typically used for composite names, e.g.
f"{algo.SHORT_ALGO_NAME}_{dataset.name}"orf"{algo.SHORT_ALGO_NAME}_{discipline.name}".
- algo: Any
The interfaced machine learning algorithm.
- learning_set: Dataset
The learning dataset.
- transformer: dict[str, Transformer]
The strategies to transform the variables, if any.
The values are instances of
Transformerwhile the keys are the names of either the variables or the groups of variables, e.g. “inputs” or “outputs” in the case of the regression algorithms. If a group is specified, theTransformerwill be applied to all the variables of this group.
- property use_hmat: bool
Whether to use the HMAT linear algebra method or LAPACK.