Classification algorithms¶
Warning
Some algorithms may require the installation of GEMSEO with all its features and some others may depend on plugins.
Note
All the features of the wrapped optimization libraries may not be exposed through GEMSEO.
KNNClassifier¶
Module: gemseo.mlearning.classification.knn
- Required parameters
data : Dataset
The learning dataset.
- Optional parameters
input_names : Iterable[str] | None, optional
The names of the input variables. If
None
, consider all the input variables of the learning dataset.By default it is set to None.
n_neighbors : int, optional
The number of neighbors.
By default it is set to 5.
output_names : Iterable[str] | None, optional
The names of the output variables. If
None
, consider all the output variables of the learning dataset.By default it is set to None.
transformer : Mapping[str, TransformerType] | None, optional
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, theTransformer
will be applied to all the variables of this group. If None, do not transform the variables.By default it is set to None.
**parameters : int | str
The parameters of the machine learning algorithm.
RandomForestClassifier¶
Module: gemseo.mlearning.classification.random_forest
- Required parameters
data : Dataset
The learning dataset.
- Optional parameters
input_names : Iterable[str] | None, optional
The names of the input variables. If
None
, consider all the input variables of the learning dataset.By default it is set to None.
n_estimators : int, optional
The number of trees in the forest.
By default it is set to 100.
output_names : Iterable[str] | None, optional
The names of the output variables. If
None
, consider all the output variables of the learning dataset.By default it is set to None.
transformer : Mapping[str, TransformerType] | None, optional
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, theTransformer
will be applied to all the variables of this group. If None, do not transform the variables.By default it is set to None.
**parameters : int | float | bool | str | None
The parameters of the machine learning algorithm.
SVMClassifier¶
Module: gemseo.mlearning.classification.svm
- Required parameters
data : Dataset
The learning dataset.
- Optional parameters
input_names : Iterable[str] | None, optional
The names of the input variables. If
None
, consider all the input variables of the learning dataset.By default it is set to None.
kernel : str | Callable | None, optional
The name of the kernel or a callable for the SVM. Examples: “linear”, “poly”, “rbf”, “sigmoid”, “precomputed” or a callable.
By default it is set to rbf.
output_names : Iterable[str] | None, optional
The names of the output variables. If
None
, consider all the output variables of the learning dataset.By default it is set to None.
probability : bool, optional
Whether to enable the probability estimates. The algorithm is faster if set to False.
By default it is set to False.
transformer : Mapping[str, TransformerType] | None, optional
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, theTransformer
will be applied to all the variables of this group. If None, do not transform the variables.By default it is set to None.
**parameters : int | float | bool | str | None
The parameters of the machine learning algorithm.