Multidimensional cluster generation in Python
Project description
pyclugen
pyclugen is a Python implementation of the clugen algorithm for generating multidimensional clusters. Each cluster is supported by a line segment, the position, orientation and length of which guide where the respective points are placed.
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
import pyclugen as cg
import numpy as np
import matplotlib.pyplot as plt
out2 = cg.clugen(2, 4, 400, [1, 0], np.pi / 8, [50, 10], 20, 1, 2)
plt.scatter(out2.points[:,0], out2.points[:,1], c=out2.clusters)
plt.show()
out3 = cg.clugen(3, 5, 10000, [0.5, 0.5, 0.5], np.pi / 16, [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()
See the documentation for more examples and a detailed description of the many possibilities offered by this package.
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:
- Fachada, N. & de Andrade, D. (2023). Generating Multidimensional Clusters With Support Lines. https://doi.org/10.48550/arXiv.2301.10327.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyclugen-0.2.0.tar.gz
(21.6 kB
view hashes)
Built Distribution
pyclugen-0.2.0-py3-none-any.whl
(18.6 kB
view hashes)