gemseo.mlearning.regression.algos.regressor_chain module#

A model chaining regression models.

During the training stage, the first regression model learns the learning dataset, the second regression model learns the learning error of the first regression model, and the $i$-th regression model learns the learning error of its predecessor.

During the prediction stage, the different regression models are evaluated from a new input data and the sum of their output data is returned.

class RegressorChain(data, settings_model=None, **settings)[source]#

Bases: BaseRegressor

Chain regression.

Parameters:
  • data (Dataset) -- The learning dataset.

  • settings_model (BaseMLAlgoSettings | None) -- The machine learning algorithm settings as a Pydantic model. If None, use **settings.

  • **settings (Any) -- The machine learning algorithm settings. These arguments are ignored when settings_model is not None.

Raises:

ValueError -- When both the variable and the group it belongs to have a transformer.

Settings#

alias of RegressorChain_Settings

add_algo(name, transformer=mappingproxy({}), **parameters)[source]#

Add a new regression algorithm in the chain.

Parameters:
  • name (str) -- The name of the regression algorithm.

  • transformer (Mapping[str, TransformerType]) --

    The strategies to transform the variables. The values are instances of [Transformer][gemseo.mlearning.transformers.transformer.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][gemseo.mlearning.transformers.transformer.Transformer] will be applied to all the variables of this group. If empty, do not transform the variables.

    By default it is set to {}.

  • **parameters (Any) -- The parameters of the regression algorithm

Return type:

None

SHORT_ALGO_NAME: ClassVar[str] = 'RegressorChain'#

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}".