Clustering algorithms#
Warning
Some capabilities may require the installation of GEMSEO with all its features and some others may depend on plugins.
Warning
All the features of the wrapped libraries may not be exposed through GEMSEO.
Note
The algorithm settings can be passed to a function of the form
function(..., settings_model: Base | None = None, **settings: Any)
either one by one:
function(..., setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...)
or using the argument name "settings"
and the Pydantic model associated with the algorithm:
settings = AlgorithmSettings(setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...)
function(..., settings_model=settings)
GaussianMixture#
Module: gemseo.mlearning.clustering.algos.gaussian_mixture
from gemseo.settings.mlearning import GaussianMixture_Settings
- Optional settings
n_clusters : <class 'int'>, optional
The number of clusters of the clustering algorithm.
By default it is set to 5.
parameters : collections.abc.Mapping[str, typing.Any], optional
Other parameters.
By default it is set to {}.
random_state : typing.Optional[typing.Annotated[int, Ge(ge=0)]], optional
The random state parameter.
If
None
, use the global random state instance fromnumpy.random
. Creating the model multiple times will produce different results. Ifint
, use a new random number generator seeded by this integer. This will produce the same results.By default it is set to 0.
transformer : collections.abc.Mapping[str, typing.Any], optional
The strategies to transform the variables.
The values are instances of
BaseTransformer
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, theBaseTransformer
will be applied to all the variables of this group. IfIDENTITY
, do not transform the variables.By default it is set to {}.
var_names : collections.abc.Sequence[str], optional
The names of the variables.
By default it is set to ().
KMeans#
Module: gemseo.mlearning.clustering.algos.kmeans
from gemseo.settings.mlearning import KMeans_Settings
- Optional settings
n_clusters : <class 'int'>, optional
The number of clusters of the clustering algorithm.
By default it is set to 5.
parameters : collections.abc.Mapping[str, typing.Any], optional
Other parameters.
By default it is set to {}.
random_state : typing.Optional[typing.Annotated[int, Ge(ge=0)]], optional
The random state parameter.
If
None
, use the global random state instance fromnumpy.random
. Creating the model multiple times will produce different results. Ifint
, use a new random number generator seeded by this integer. This will produce the same results.By default it is set to 0.
transformer : collections.abc.Mapping[str, typing.Any], optional
The strategies to transform the variables.
The values are instances of
BaseTransformer
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, theBaseTransformer
will be applied to all the variables of this group. IfIDENTITY
, do not transform the variables.By default it is set to {}.
var_names : collections.abc.Sequence[str], optional
The names of the variables.
By default it is set to ().