Skip to main content

Constrained clustering library for Python

Project description

Clustlib: Constrained Clustering Library

Code style: black Python version: 3.12

[!NOTE] 🚧 Currently the project is a Work in progress, but you can help us to fix it.

Please refer to our contributing documenation to know how can you start helping us

[!WARNING] This Library is a Work in progress at the moment, most use cases may not be contempleted or supported yet. If you find something feel free to create a bug report.

In the same way if you think we are missing something important create a feature request

What it is?

Clustlib is a Python library that provides a unified framework for constrained clustering algorithms.

Unlike traditional clustering, where groups are formed purely from data similarity, constrained clustering integrates prior knowledge in the form of must-link and cannot-link constraints.

This library includes implementations of both classic algorithms and state-of-the-art metaheuristics, enabling researchers and practitioners to experiment, compare, and extend methods in a common environment.

If you want to know more deep in our documentation

✨ Key Features

  • Unified Python API across all algorithms
  • Support for must-link and cannot-link constraints
  • Scikit-learn inspired design for easy integration
  • Implementations from different families:
    • K-Means based methods
    • Bayesian models
    • Evolutionary and metaheuristic approaches
  • Modular and extensible codebase

🚀 Installation

pip install clustlib

Basic Usage

from clustlib.kmeans import COPKMeans

constraints = np.zeros((X.shape[0], X.shape[0]))

# Example: COP-KMeans
model = COPKMeans(n_clusters=3, constraints=constraints)
model.fit(X)
labels = model.labels_

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clustlib-0.1.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clustlib-0.1.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file clustlib-0.1.0.tar.gz.

File metadata

  • Download URL: clustlib-0.1.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for clustlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f29e5e8fd98439d22818ed5f080f3518f6c187d2a838da8f475d9db1a2c36045
MD5 6a2ac8d410f081df5b160c65a51b1cc1
BLAKE2b-256 7de2d89e0e2f1b1486e112b5bc705751532844096afabda5e85f2e5e136b8b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for clustlib-0.1.0.tar.gz:

Publisher: pypi-publish.yml on lordisma/pyCC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clustlib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clustlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for clustlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70a6f12386d7a48d03128a9ab67bf68071b3f14574ccbe1599cb4ea02a10cad7
MD5 77fe3494ed653acae1b6f537d43e3f0e
BLAKE2b-256 128275399678cde50a15daec4525e23658f1d9fce976c1bf88693091bed877ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for clustlib-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on lordisma/pyCC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page