gemseo_mlearning / regression

Show inherited members

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: MLRegressionAlgo

Gaussian 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 Transformer while 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, the Transformer will be applied to all the variables of this group. If IDENTITY, 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 than MAX_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: StrEnum

The 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.

Parameters:

input_data (ndarray | Mapping[str, ndarray]) – The input data with shape (n_samples, n_inputs).

Returns:

The output data with shape (n_samples, n_outputs).

Return type:

output_data

HMATRIX_ASSEMBLY_EPSILON: ClassVar[float] = 1e-05

The epsilon used for the assembly of the H-matrix.

Used when use_hmat is True.

HMATRIX_RECOMPRESSION_EPSILON: ClassVar[float] = 0.0001

The epsilon used for the recompression of the H-matrix.

Used when use_hmat is True.

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}" or f"{algo.SHORT_ALGO_NAME}_{discipline.name}".

algo: Any

The interfaced machine learning algorithm.

input_names: list[str]

The names of the input variables.

input_space_center: dict[str, ndarray]

The center of the input space.

learning_set: Dataset

The learning dataset.

output_names: list[str]

The names of the output variables.

parameters: dict[str, MLAlgoParameterType]

The parameters of the machine learning algorithm.

transformer: dict[str, Transformer]

The strategies to transform the variables, if any.

The values are instances of Transformer while 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, the Transformer will be applied to all the variables of this group.

property use_hmat: bool

Whether to use the HMAT linear algebra method or LAPACK.