Classification algorithms¶
Warning
Some capabilities may require the installation of GEMSEO with all its features and some others may depend on plugins.
Note
All the features of the wrapped libraries may not be exposed through GEMSEO.
KNNClassifier¶
Module: gemseo.mlearning.classification.knn
- Required parameters
data : IODataset
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 : TransformerType, 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. IfIDENTITY
, do not transform the variables.By default it is set to {}.
**parameters : int | str
The parameters of the machine learning algorithm.
RandomForestClassifier¶
Module: gemseo.mlearning.classification.random_forest
- Required parameters
data : IODataset
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.
random_state : int | None, optional
The random state passed to the random number generator. Use an integer for reproducible results.
By default it is set to 0.
transformer : TransformerType, 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. IfIDENTITY
, do not transform the variables.By default it is set to {}.
**parameters : int | float | bool | str | None
The parameters of the machine learning algorithm.
SVMClassifier¶
Module: gemseo.mlearning.classification.svm
- Required parameters
data : IODataset
The learning dataset.
- Optional parameters
C : float, optional
The inverse L2 regularization parameter. Higher values give less regularization.
By default it is set to 1.0.
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.
random_state : int | None, optional
The random state passed to the random number generator. Use an integer for reproducible results.
By default it is set to 0.
transformer : TransformerType, 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. IfIDENTITY
, do not transform the variables.By default it is set to {}.
**parameters : int | float | bool | str | None
The parameters of the machine learning algorithm.