Skip to main content

Multidimensional cluster generation in Python

Project description

Tests codecov docs PyPI PyPI - Downloads MIT

pyclugen

pyclugen is a Python implementation of the clugen algorithm for generating multidimensional clusters with arbitrary distributions. Each cluster is supported by a line segment, the position, orientation and length of which guide where the respective points are placed.

See the documentation and examples for more details.

Installation

Install from PyPI:

pip install --upgrade pip
pip install pyclugen

Or directly from GitHub:

pip install --upgrade pip
pip install git+https://github.com/clugen/pyclugen.git#egg=pyclugen

Quick start

from pyclugen import clugen
import matplotlib.pyplot as plt
out2 = clugen(2, 4, 400, [1, 0], 0.4, [50, 10], 20, 1, 2)
plt.scatter(out2.points[:, 0], out2.points[:, 1], c=out2.clusters)
plt.show()

2D example.

out3 = clugen(3, 5, 10000, [0.5, 0.5, 0.5], 0.2, [10, 10, 10], 10, 1, 2)
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
ax.scatter(out3.points[:, 0], out3.points[:, 1], out3.points[:, 2], c=out3.clusters)
plt.show()

3D example.

See also

  • CluGen.jl, a Julia implementation of the clugen algorithm.
  • clugenr, an R implementation of the clugen algorithm.
  • MOCluGen, a MATLAB/Octave implementation of the clugen algorithm.

Reference

If you use this software, please cite the following reference:

License

MIT License

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

pyclugen-1.1.4.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

pyclugen-1.1.4-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file pyclugen-1.1.4.tar.gz.

File metadata

  • Download URL: pyclugen-1.1.4.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyclugen-1.1.4.tar.gz
Algorithm Hash digest
SHA256 3185aac637dff64307d6f73fa3bd70b16a571522493df1d355f25af95bd47994
MD5 ff249d47b35d16cb3028c0501719341f
BLAKE2b-256 e80c16cf413a133dd9b7ff11d4c34b3894c7032a81776effae119a32c8e21ba0

See more details on using hashes here.

File details

Details for the file pyclugen-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: pyclugen-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyclugen-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2f3531cd74ab49e42b07a275d980a90f22a4a7a7d96c0a3799df0dd4ed0e9f
MD5 ad93cdfe323706d4453ce1d4b75197a2
BLAKE2b-256 2feef6fc82e1df31ccb30701564fe0b17f4fc2f27372ba20ba215df584888c8f

See more details on using hashes here.

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