Skip to main content

Tool to generate biclustering and triclustering datasets

Project description

Nclustgen

Nclustgen is a python tool to generate biclustering and triclustering datasets programmatically.

It wraps two java packages G-Bic, and G-Tric, that serve as backend generators. If you are interested on a GUI version of this generator or on using this generator in a java environment check out those packages.

This tool adds some functionalities to the original packages, for a more fluid interaction with python libraries, like:

  • Conversion to numpy arrays
  • Conversion to sparse tensors
  • Conversion to networkX or dgl n-partite graphs

Installation

This tool can be installed from PyPI:

pip install nclustgen

NOTICE: Nclustgen installs by default the dgl build with no cuda support, in case you want to use gpu you can override this by installing the correct dgl build, more information at: https://www.dgl.ai/pages/start.html.

Getting started

Here are the basics, the full documentation is available at: http://nclustgen.readthedocs.org.

## Generate biclustering dataset

from nclustgen import BiclusterGenerator

# Initialize generator
generator = BiclusterGenerator(
    dstype='NUMERIC',
    patterns=[['CONSTANT', 'CONSTANT'], ['CONSTANT', 'NONE']],
    bktype='UNIFORM',
    in_memory=True,
    silence=True
)

# Get parameters
generator.get_params()

# Generate dataset
x, y = generator.generate(nrows=50, ncols=100, nclusters=3)

# Build graph
graph = generator.to_graph(x, framework='dgl', device='cpu')

# Save data files
generator.save(file_name='example', single_file=True)

## Generate triclustering dataset

from nclustgen import TriclusterGenerator

# Initialize generator
generator = TriclusterGenerator(
    dstype='NUMERIC',
    patterns=[['CONSTANT', 'CONSTANT', 'CONSTANT'], ['CONSTANT', 'NONE', 'NONE']],
    bktype='UNIFORM',
    in_memory=True,
    silence=True
)

# Get parameters
generator.get_params()

# Generate dataset
x, y = generator.generate(nrows=50, ncols=100, ncontexts=10, nclusters=25)

# Build graph
graph = generator.to_graph(x, framework='dgl', device='cpu')

# Save data files
generator.save(file_name='example', single_file=True)

License

GPLv3

Documentation

The documentation is available at: https://nclustgen.readthedocs.org.

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

nclustgen-1.0.2.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

nclustgen-1.0.2-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file nclustgen-1.0.2.tar.gz.

File metadata

  • Download URL: nclustgen-1.0.2.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nclustgen-1.0.2.tar.gz
Algorithm Hash digest
SHA256 df7a59a8d16adff7e529d4b2d1a32fafda22670d2e5e8c324268643477a8fada
MD5 ff674b4164225d814d3ccb286b5a3adb
BLAKE2b-256 38a2d7e55279c9391b57a4be95243d21006689b6d735862a582269b406c08f53

See more details on using hashes here.

File details

Details for the file nclustgen-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: nclustgen-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nclustgen-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 92fd7cfcb2c43f3b68a43bdb4af5644c3ca1c1b17108b6d302dd3c694fa16e15
MD5 2746f940601141c7c09c57c06bbd8865
BLAKE2b-256 eee5de42e942fd42977a1c263450d0a5f61166b0f6a4e2d6fa92ba1b039dc6e1

See more details on using hashes here.

Supported by

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