.. _f-classificationkmeans: module ``mlmodel.classification_kmeans`` ======================================== .. inheritance-diagram:: mlinsights.mlmodel.classification_kmeans Short summary +++++++++++++ module ``mlinsights.mlmodel.classification_kmeans`` Combines a *k-means* followed by a predictor. :githublink:`%|py|5` Classes +++++++ +-------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +=================================================================================================+=====================================================================================================================+ | :class:`ClassifierAfterKMeans ` | Applies a *k-means* (see :epkg:`sklearn:cluster:KMeans`) for each class, then adds the distance to each cluster ... | +-------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ Properties ++++++++++ +-----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +=====================================================================================================+==================================================================================================================+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +-----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +================================================================================================================+================================================================================================================+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | Overloads `repr` as *scikit-learn* now relies on the constructor signature. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`decision_function ` | Calls *decision_function*. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Runs a *k-means* on each class then trains a classifier on the extended set of features. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`get_params ` | Returns the parameters for both the clustering and the classifier. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`predict ` | Runs the predictions. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`predict_proba ` | Converts predictions into probabilities. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`set_params ` | Sets the parameters before training. Every parameter prefixed by ``'e_'`` is an estimator parameter, every ... | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :meth:`transform_features ` | Applies all the clustering objects on every observations and extends the list of features. | +----------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlinsights.mlmodel.classification_kmeans :members: :special-members: __init__ :show-inheritance: