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
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
Built Distribution
File details
Details for the file nclustgen-1.0.3.tar.gz
.
File metadata
- Download URL: nclustgen-1.0.3.tar.gz
- Upload date:
- Size: 25.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb872d5f569f008be45e928967b7f2ac6c1f7f090553395898c86b66d9d2ecb9 |
|
MD5 | 68d637115d2976930efc8e23fa959172 |
|
BLAKE2b-256 | 2fb17cb8ca909d69222908203a843fc4620bdc9aa7f34e64a5619284359b552f |
File details
Details for the file nclustgen-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: nclustgen-1.0.3-py3-none-any.whl
- Upload date:
- Size: 25.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65a8c5038ea172d592a58fcced783756154a126ff5043d5d28b46a8345685804 |
|
MD5 | e13ef53ed30b230fddff5d82920c7ea1 |
|
BLAKE2b-256 | c8de7c2ca3e28d19a1aa1cd923dccf05130915fca0dc27b80afbd9195aef44af |