api module¶
Machine learning API.
The machine learning API provides methods for creating new and loading existing machine learning models. It also provides methods for listing available models and options.
- gemseo.mlearning.api.create_classification_model(name, data, transformer=mappingproxy({'inputs': <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object>}), **parameters)[source]¶
Create a classification model from a learning dataset.
- Parameters:
name (str) – The name of the classification algorithm.
data (Dataset) – The learning dataset.
transformer (MutableMapping[str, Union[str, Tuple[str, Mapping[str, Any]], Transformer]]) –
The strategies to transform the variables. Values are instances of
Transformer
while keys are names of either variables or groups of variables. IfIDENTITY
, do not transform the variables.By default it is set to {‘inputs’: <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object at 0x7fcd0601a850>}.
parameters – The parameters of the classification model.
- Returns:
A classification model.
- Return type:
- gemseo.mlearning.api.create_clustering_model(name, data, transformer=mappingproxy({}), **parameters)[source]¶
Create a clustering model from a learning dataset.
- Parameters:
name (str) – The name of the clustering algorithm.
data (Dataset) – The learning dataset.
transformer (MutableMapping[str, Union[str, Tuple[str, Mapping[str, Any]], Transformer]]) –
The strategies to transform the variables. Values are instances of
Transformer
while keys are names of either variables or groups of variables. IfIDENTITY
, do not transform the variables.By default it is set to {}.
parameters – The parameters of the clustering model.
- Returns:
A clustering model.
- Return type:
- gemseo.mlearning.api.create_mlearning_model(name, data, transformer=mappingproxy({}), **parameters)[source]¶
Create a machine learning algorithm from a learning dataset.
- Parameters:
name (str) – The name of the machine learning algorithm.
data (Dataset) – The learning dataset.
transformer (MutableMapping[str, Union[str, Tuple[str, Mapping[str, Any]], Transformer]]) –
The strategies to transform the variables. Values are instances of
Transformer
while keys are names of either variables or groups of variables. IfIDENTITY
, do not transform the variables.By default it is set to {}.
parameters – The parameters of the machine learning algorithm.
- Returns:
A machine learning model.
- Return type:
- gemseo.mlearning.api.create_regression_model(name, data, transformer=mappingproxy({'inputs': <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object>, 'outputs': <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object>}), **parameters)[source]¶
Create a regression model from a learning dataset.
- Parameters:
name (str) – The name of the regression algorithm.
data (Dataset) – The learning dataset.
transformer (MutableMapping[str, Union[str, Tuple[str, Mapping[str, Any]], Transformer]]) –
The strategies to transform the variables. Values are instances of
Transformer
while keys are names of either variables or groups of variables. IfIDENTITY
, do not transform the variables.By default it is set to {‘inputs’: <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object at 0x7fcd0607f130>, ‘outputs’: <gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler object at 0x7fcd0607f0d0>}.
parameters – The parameters of the regression model.
- Returns:
A regression model.
- Return type:
- gemseo.mlearning.api.get_classification_options(model_name, output_json=False, pretty_print=True)[source]¶
Find the available options for a classification model.
- Parameters:
- Returns:
The options schema of the classification model.
- Return type:
- gemseo.mlearning.api.get_clustering_options(model_name, output_json=False, pretty_print=True)[source]¶
Find the available options for clustering model.
- Parameters:
- Returns:
The options schema of the clustering model.
- Return type:
- gemseo.mlearning.api.get_mlearning_options(model_name, output_json=False, pretty_print=True)[source]¶
Find the available options for a machine learning algorithm.
- Parameters:
- Returns:
The options schema of the machine learning algorithm.
- Return type:
- gemseo.mlearning.api.get_regression_options(model_name, output_json=False, pretty_print=True)[source]¶
Find the available options for a regression model.
- Parameters:
- Returns:
The options schema of the regression model.
- Return type:
- gemseo.mlearning.api.import_classification_model(directory)[source]¶
Import a classification model from a directory.
- Parameters:
directory (str | Path) – The path to the directory.
- Returns:
A classification model.
- Return type:
- gemseo.mlearning.api.import_clustering_model(directory)[source]¶
Import a clustering model from a directory.
- Parameters:
directory (str | Path) – The path to the directory.
- Returns:
A clustering model.
- Return type:
- gemseo.mlearning.api.import_mlearning_model(directory)[source]¶
Import a machine learning algorithm from a directory.
- gemseo.mlearning.api.import_regression_model(directory)[source]¶
Import a regression model from a directory.
- Parameters:
directory (str | Path) – The path of the directory.
- Returns:
A regression model.
- Return type: