An API for machine learning¶
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=None, **parameters)[source] Create a classification model from a learning data set.
- Parameters
name (str) – name of the classification model.
data (Dataset) – learning data set.
transformer (dict(str)) – transformation strategy for data groups. If None, do not transform data. Default: None.
parameters – classification model parameters.
-
gemseo.mlearning.api.
create_clustering_model
(name, data, transformer=None, **parameters)[source] Create a clustering model from a learning data set.
- Parameters
name (str) – name of the clustering model.
data (Dataset) – learning data set.
transformer (dict(str)) – transformation strategy for data groups. If None, do not transform data. Default: None.
parameters – clustering model parameters.
-
gemseo.mlearning.api.
create_mlearning_model
(name, data, transformer=None, **parameters)[source] Create machine learning algorithm from a learning data set.
- Parameters
name (str) – name of the machine learning algorithm.
data (Dataset) – learning data set.
transformer (dict(str)) – transformation strategy for data groups. If None, do not transform data. Default: None.
parameters – machine learning algorithm parameters.
-
gemseo.mlearning.api.
create_regression_model
(name, data, transformer=None, **parameters)[source] Create a regression model from a learning data set.
- Parameters
name (str) – name of the regression model.
data (Dataset) – learning data set.
transformer (dict(str)) – transformation strategy for data groups. If None, do not transform data. Default: None.
parameters – regression model parameters.
-
gemseo.mlearning.api.
get_classification_models
()[source] Get available classification models.
-
gemseo.mlearning.api.
get_classification_options
(model_name, output_json=False, pretty_print=True)[source] Lists the available options for a classification model.
- Parameters
model_name (str) – Name of the classification model.
output_json (bool) – Apply json format for the schema.
pretty_print (bool) – Print the schema in a pretty table.
- Returns
Option schema (string) of the classification model.
-
gemseo.mlearning.api.
get_clustering_models
()[source] Get available clustering models.
-
gemseo.mlearning.api.
get_clustering_options
(model_name, output_json=False, pretty_print=True)[source] Lists the available options for clustering model.
- Parameters
model_name (str) – Name of the clustering model.
output_json (bool) – Apply json format for the schema.
pretty_print (bool) – Print the schema in a pretty table.
- Returns
Option schema (string) of the clustering model.
-
gemseo.mlearning.api.
get_mlearning_models
()[source] Get available machine learning algorithms.
-
gemseo.mlearning.api.
get_mlearning_options
(model_name, output_json=False, pretty_print=True)[source] Lists the available options for a machine learning algorithm.
- Parameters
model_name (str) – Name of the machine learning algorithm.
output_json (bool) – Apply json format for the schema.
pretty_print (bool) – Print the schema in a pretty table.
- Returns
Option schema (string) of the machine learning algorithm.
-
gemseo.mlearning.api.
get_regression_models
()[source] Get available regression models.
-
gemseo.mlearning.api.
get_regression_options
(model_name, output_json=False, pretty_print=True)[source] Lists the available options for a regression model.
- Parameters
model_name (str) – Name of the regression model.
output_json (bool) – Apply json format for the schema.
pretty_print (bool) – Print the schema in a pretty table.
- Returns
Option schema (string) of the regression model.
-
gemseo.mlearning.api.
import_classification_model
(directory)[source] Import a classification model from a directory.
- Parameters
directory (str) – directory name.
-
gemseo.mlearning.api.
import_clustering_model
(directory)[source] Import a clustering model from a directory.
- Parameters
directory (str) – directory name.
-
gemseo.mlearning.api.
import_mlearning_model
(directory)[source] Import a machine learning algorithm from a directory.
- Parameters
directory (str) – directory name.
-
gemseo.mlearning.api.
import_regression_model
(directory)[source] Import a regression model from a directory.
- Parameters
directory (str) – directory name.
Development¶
This API relies on a mechanism of factories dedicated to the different families of machine learning algorithms and inheriting from a common machine learning factory.