Skip to main content

Soft Clustering Python Package

https://github.com/soft-clustering/soft-clustering/blob/main/SCPP_Poster.png

Soft Clustering is a comprehensive Python library for soft and fuzzy clustering algorithms. It provides a wide range of state-of-the-art methods for membership-based, possibilistic, evidential, graph, document, and deep clustering models.

This package is designed to support research and applied workflows involving clustering under uncertainty, overlapping memberships, and soft assignments.

Official documentation is available at:

https://soft-clustering.readthedocs.io/en/latest/index.html

Features

  • Fuzzy clustering: FCM, PCM, GK, SCM, SISC, KFCM, PFCM, CAFCM, and related variants

  • Probabilistic and mixture models: GMM, LDA, PLSI, MBMM, MMSB, BGMM

  • Rough and possibilistic clustering: RoughKMeans, WBSC, NOCD, DMon, RDFKC

  • Nonnegative matrix factorization and graph clustering: BayesianNMF, BIGCLAM, CDCgS, SoftDBSCANGM

  • Document and graph clustering methods: KMART, SCSPA and additional soft clustering algorithms

Installation

The complete package, including deep learning-based algorithms, can be installed from PyPI using:

pip install soft-clustering[deep]

For users who only need the core algorithms (without deep learning dependencies), install the base version:

pip install soft-clustering

Quick Start

Basic usage with the package API:

import numpy as np
from soft_clustering import FCM

X = np.array([[1.0, 2.0], [1.1, 2.1], [8.0, 8.1], [8.2, 7.9]])
model = FCM(m=2.0, max_iter=150, tol=1e-5)
memberships = model.fit_predict(X, K=2)
centers = model.centers_

print("Soft membership shape:", memberships.shape)
print("Cluster centers:", centers)

Documentation

Full API reference, examples, algorithm descriptions, and usage guides are available in the official documentation:

https://soft-clustering.readthedocs.io/en/latest/index.html

Testing

The project includes a comprehensive test suite in the tests/ directory, covering all implemented algorithms.

To run the tests:

pip install -e ".[deep,dev]"   # Install in development mode
pytest

See tests/HOW_TO_RUN.txt for more details.

Research & Citation

This package is part of an academic research project submitted to the JMLR MLOSS journal. A publication is forthcoming.

@misc{rezaee2026scppunifiedpythonlibrary,
   title={SCPP: A Unified Python Library for Soft Clustering},
   author={Kiyan Rezaee and Morteza Ziabakhsh and Artin Bahrampour and Seyed Mohammad Ghoreishi and Asal Khaje and Ali Sajedifar and Manny Chalak and Ava Zerafatangiz and Sadegh Eskandari},
   year={2026},
   eprint={2607.19620},
   archivePrefix={arXiv},
   primaryClass={cs.LG},
   url={https://arxiv.org/abs/2607.19620},
}

Contributing

Contributions, bug reports, and feature requests are welcome. Please open issues or pull requests on the repository.

Please see our:

License

Distributed under the terms of the MIT license.

Metadata

Release files for soft-clustering 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soft-clustering 0.0.2
File Size Uploaded
soft_clustering-0.0.2.tar.gz 48.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soft-clustering 0.0.2
File Interpreter ABI Platform
soft_clustering-0.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 117.0 kB

Release files / soft_clustering-0.0.2.tar.gz

Download URL soft_clustering-0.0.2.tar.gz
Size 48.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b1bd8293d38ebc007c54ba97769642149506317550f52e51b991884dcfa2b81d
BLAKE2b-256 checksum
How to use checksums
d97d85ce7d4332a66013520ed1dda6fae755e7ba91aa4139f831db5cf3b52bd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / soft_clustering-0.0.2-py2.py3-none-any.whl

Download URL soft_clustering-0.0.2-py2.py3-none-any.whl
Size 68.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
30bff04ae32bdc7049373f9ab8793b6aa4da822cb3637832eec2f0bbe888f02c
BLAKE2b-256 checksum
How to use checksums
ddafbb119bf41c9573190d1736356a17f97cbbbab21a875ab895850855098d8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.2.0

2 release files

0.0.3

2 release files

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page