$npx skillfedfor your agent

kmodes

Python implementations of the k-modes and k-prototypes clustering algorithms for clustering categorical data.

With conditionsPyPI Scientific/EngineeringReleased Sep 2022561.9K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — kmodes-0.12.2-py2.py3-none-any.whl
v0.12.2 · released 2022-09-06 · 4 runtime deps: numpy, scikit-learn, scipy, joblib

Yes, if you need to cluster categorical or mixed-type data and want a scikit-learn-compatible interface. The low install friction and permissive license make it a straightforward choice. However, the dormant maintenance status (last release 2022-09-06) warrants checking compatibility with your current numpy and scikit-learn versions before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Input data must have consistent data types within columns; NaN values are not accepted and must be handled before clustering.
  • Low friction install with standard dependencies (numpy, scikit-learn, scipy, joblib).
  • Maintenance is dormant—last release was 2022-09-06, though the repository remains active with recent commits and no archived status.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include the license text in distributions.

last release 2022-09-06 (1438 days) · last repo commit 2024-06-19 · 1,285 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 561,891 downloads/mo, #5,992 on PyPI

Verify before relying

pip install kmodes

import numpy as np
from kmodes.kmodes import KModes

data = np.random.choice(20, (100, 10))
km = KModes(n_clusters=4, init='Huang', n_init=5, verbose=1)
clusters = km.fit_predict(data)
  • Whether the dormant maintenance status affects compatibility with current numpy/scikit-learn versions.
  • Performance characteristics and scalability limits for large datasets relative to alternatives.
Same gist for agents: .md · .json

What it is and what it does

kmodes provides Python implementations of k-modes and k-prototypes clustering, specialized for categorical and mixed data types. Unlike k-means, which clusters numerical data by Euclidean distance, k-modes clusters categorical variables by counting matching categories between points. k-prototypes extends this to handle datasets with both numerical and categorical features. The library mirrors scikit-learn's clustering API, making it familiar to users of that ecosystem.

The package relies on numpy for computation and supports parallel execution via joblib for multiple initialization runs. It includes initialization strategies such as Huang's method and density-based approaches. All runtime dependencies (numpy, scikit-learn, scipy, joblib) are standard data-science libraries with low installation friction.

Use it for

  • Cluster customer records with mixed demographic (categorical) and behavioral (numerical) attributes.
  • Segment product categories or survey responses where most features are discrete or nominal.
  • Analyze categorical genomic or medical data where Euclidean distance is not meaningful.
  • Reduce dimensionality or find patterns in text-encoded or one-hot-encoded feature sets.
  • Benchmark or compare k-modes results against k-means on datasets with predominantly categorical features.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to cluster categorical or mixed-type data and want a scikit-learn-compatible interface.

The low install friction and permissive license make it a straightforward choice. However, the dormant maintenance status (last release 2022-09-06) warrants checking compatibility with your current numpy and scikit-learn versions before committing to production use.

Install

kmodes on PyPI

Before you install

Low friction install with standard dependencies (numpy, scikit-learn, scipy, joblib). Maintenance is dormant—last release was 2022-09-06, though the repository remains active with recent commits and no archived status.

Input data must have consistent data types within columns; NaN values are not accepted and must be handled before clustering.

License in practice

MIT license permits commercial and private use with minimal restrictions; you must include the license text in distributions.

Quickstart

pip install kmodes

import numpy as np
from kmodes.kmodes import KModes

data = np.random.choice(20, (100, 10))
km = KModes(n_clusters=4, init='Huang', n_init=5, verbose=1)
clusters = km.fit_predict(data)

Verify before relying

  • Whether the dormant maintenance status affects compatibility with current numpy/scikit-learn versions.
  • Performance characteristics and scalability limits for large datasets relative to alternatives.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
numpyscikit-learnscipyjoblib
MaintenanceDormant 1,438 days since the last release
Last repo commit
First released
Downloads561,891 / month, #5,992 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Evidence: kmodes-0.12.2-py2.py3-none-any.whl

Tags

Capabilities
categorical clusteringk-modes algorithmk-prototypes mixed datacategorical data clusteringnon-numeric clusteringmode-based clusteringscikit-learn clustering alternative
Topics
clusteringcategorical-datascikit-learn-compatible

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “categorical clustering”

  • kmodesImplements k-modes and k-prototypes clustering algorithms for…
  • esdaesda computes global and local spatial autocorrelation statistics,…
  • category-encodersTransforms categorical variables into numeric representations using…

Give your agent the search over MCP, or paste the wish link into any chat.

More Scientific/Engineering packages

numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
pandas Worth it
PyPI · Scientific/Engineering · released Jul 2026

pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.

BSD-3-Clausecompiled wheel · 3.11+
769.1Mdownloads / mo
scipy Worth it
PyPI · Libraries · released Jun 2026

scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.

BSD-3-Clausecompiled wheel · 3.12+
449.0Mdownloads / mo
scikit-learn Worth it
PyPI · Software Development · released Jun 2026

scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.

Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.

BSD-3-Clausecompiled wheel · 3.11+
235.5Mdownloads / mo
dill Worth it
PyPI · Software Development · released Jan 2026

dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.

BSD-3-Clausepure Python · 3.9+
208.1Mdownloads / mo
multiprocess Worth it
PyPI · Software Development · released Jan 2026

Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.

Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.

BSD-3-Clausepure Python · 3.9+
202.7Mdownloads / mo

See also jenkspy · k-means-constrained · gmr · hdbscan · category-encoders · prince · formulaic-contrasts · phik · kneed

Further reading