.. _f-kmeans022: module ``mlmodel._kmeans_022`` ============================== Short summary +++++++++++++ module ``mlinsights.mlmodel._kmeans_022`` Implements k-means with norms L1 and L2. :githublink:`%|py|6` Functions +++++++++ +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +============================================================================================================+==========================================================================================================================+ | :func:`_assign_labels_array ` | Compute label assignment and inertia for a dense array Return the inertia (sum of squared distances to the centers). ... | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :func:`_assign_labels_csr ` | Compute label assignment and inertia for a CSR input Return the inertia (sum of squared distances to the centers). | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :func:`_centers_dense ` | M step of the K-means EM algorithm Computation of cluster centers / means. | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :func:`_centers_sparse ` | M step of the K-means EM algorithm Computation of cluster centers / means. | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :func:`_labels_inertia_precompute_dense ` | Computes labels and inertia using a full distance matrix. This will overwrite the 'distances' array in-place. | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :func:`_labels_inertia_skl ` | E step of the K-means EM algorithm. Compute the labels and the inertia of the given samples and centers. This will ... | +------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlinsights.mlmodel._kmeans_022 :members: :special-members: __init__ :show-inheritance: