factory module¶
A factory to create classification models.
This module contains a factory to instantiate a MLClassificationAlgo
from its class name.
It also provides a list of available classification models and allows to test if a classification model type is available.
Classes:
This factory instantiates a |
- class gemseo.mlearning.classification.factory.ClassificationModelFactory[source]¶
Bases:
gemseo.mlearning.core.factory.MLAlgoFactory
This factory instantiates a
MLRegressionAlgo
from its class name.The class can be either internal to GEMSEO or external. In this second case, it can be either implemented in a module referenced in the “GEMSEO_PATH” or in a module The class can be either internal to GEMSEO or external. In the second case, it can be either implemented in a module referenced in the GEMSEO_PATH environment variable or in a module starting with “gemseo_” and referenced in the PYTHONPATH environment variable.
Methods:
create
(ml_algo, **options)Create an instance of a machine learning algorithm.
is_available
(ml_algo)Check the availability of a machine learning algorithm.
load
(directory)Load an instance of machine learning algorithm from the disk.
Attributes:
The available machine learning algorithms.
- Return type
None
- create(ml_algo, **options)¶
Create an instance of a machine learning algorithm.
- Parameters
ml_algo (str) – The name of a machine learning algorithm (its class name).
**options (Optional[Union[gemseo.core.dataset.Dataset, Dict[str, gemseo.mlearning.transform.transformer.Transformer], Any]]) – The options of the machine learning algorithm.
- Returns
The instance of the machine learning algorithm.
- Return type
- is_available(ml_algo)¶
Check the availability of a machine learning algorithm.
- Parameters
ml_algo (str) – The name of a machine learning algorithm (its class name).
- Returns
Whether the machine learning algorithm is available.
- Return type
bool
- load(directory)¶
Load an instance of machine learning algorithm from the disk.
- Parameters
directory (Union[str, pathlib.Path]) – The name of the directory containing an instance of a machine learning algorithm.
- Returns
The instance of the machine learning algorithm.
- Return type
- property models¶
The available machine learning algorithms.