Skip to main content

pyhuge Python Package

pyhuge is the native Python package for high-dimensional undirected graph estimation and inference, sharing the same C++ core as the R huge package.

Table of contents

Background

pyhuge runs natively in Python with a shared C++ backend and does not require an R runtime.

Directory structure

  • pyhuge/: package source code
  • pyhuge/data/: packaged datasets (stockdata.npz)
  • cpp/: optional pybind11 acceleration kernels
  • tests/: unit/e2e/parity tests
  • examples/: runnable scripts
  • docs/: MkDocs documentation pages
  • scripts/: release and docs helper scripts

What this package provides

  • Core estimators: huge, huge_mb, huge_glasso, huge_ct, huge_tiger
  • Model selection: huge_select (ric, stars, ebic)
  • Data transforms and utilities: huge_npn, huge_generator, huge_roc, huge_inference
  • Plotting helpers: huge_plot_sparsity, huge_plot_roc, huge_plot_graph_matrix, huge_plot_network, huge_plot
  • Dataset helper: huge_stockdata
  • Diagnostics: pyhuge.test(), pyhuge-doctor

Requirements

  • Python >=3.9
  • Runtime packages: numpy, scipy
  • Native extension: pyhuge._native_core is required for mb, tiger, glasso
  • Native source builds: Linux or macOS; Windows is not currently supported

Optional:

  • plotting: matplotlib, networkx
  • docs: mkdocs, mkdocs-material

Installation

Published Linux x86_64 wheels bundle OpenBLAS and the OpenMP runtime:

pip install "pyhuge[runtime]"

Linux source builds require a C++17 compiler and OpenBLAS development files (libopenblas-dev on Ubuntu/Debian or openblas-devel on Fedora/RHEL).

From source:

cd python-package
pip install -e ".[runtime]"

Optional extras:

pip install -e ".[viz]"
pip install -e ".[test]"
pip install -e ".[docs]"
pip install -e ".[dev]"

Runtime check:

python -c "import pyhuge; print(pyhuge.test())"
pyhuge-doctor

Usage

import numpy as np
from pyhuge import huge, huge_select

rng = np.random.default_rng(1)
x = rng.normal(size=(120, 30))

fit = huge(x, method="mb", nlambda=8, verbose=False)
sel = huge_select(fit, criterion="ric", verbose=False)

print(fit.method, len(fit.path), sel.opt_lambda, sel.opt_sparsity)

input_type="auto" preserves covariance detection by symmetry. For an observation matrix that is itself square and symmetric, set input_type="data" explicitly; use "covariance" to require covariance or correlation input.

Network visualization:

import matplotlib.pyplot as plt
from pyhuge import huge_plot_network

fig, ax = plt.subplots(figsize=(5, 5))
huge_plot_network(fit, index=-1, ax=ax, layout="spring")
plt.show()

Documentation

  • Docs source: python-package/docs
  • Function manual pages: python-package/docs/man

Build locally:

cd python-package
mkdocs build --strict

Developer workflow

cd python-package
pytest
bash scripts/build_dist.sh
python scripts/bump_version.py 2.0.1
bash scripts/release.sh 2.0.1

Citation

If you use huge/pyhuge in research, cite:

@article{zhao2012huge,
  title   = {The huge Package for High-dimensional Undirected Graph Estimation in R},
  author  = {Zhao, Tuo and Liu, Han and Roeder, Kathryn and Lafferty, John and Wasserman, Larry},
  journal = {Journal of Machine Learning Research},
  volume  = {13},
  pages   = {1059--1062},
  year    = {2012}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhuge-2.0.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

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

pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pyhuge-2.0.1.tar.gz.

File metadata

  • Download URL: pyhuge-2.0.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyhuge-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b44308832d95e51b2ebff76c64866e95e630990f510894b1f1044652fab4dca7
MD5 10ad1480c51a2d0f2d8147e86d9561e5
BLAKE2b-256 2fb66792ab981bdd90d1cb3622f949f170e6f7fa7a5df6f566f8747be1a1a629

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1.tar.gz:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4021cce2873645bf179e4c6ff8fb855bd435a738c6df439a33a01c11001de8d2
MD5 9f8303405ff6e58b572c9cbae6568794
BLAKE2b-256 3e6a8308de0fdea3186fba77708dc1a84cd945de7ae263ebccdbc8c2aee42788

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b20a79ca9070acf6e9bf22082b17b1a0df025e38e2adc80945ae822f9829f657
MD5 6fa73147a7795f0c6bbf06d86b5101ad
BLAKE2b-256 39c089db93478fe2e5cda05488569148fdd129dd557e204fea7e526ff719cc68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9da4a8e539ac89bd665f6b8de61e185a62c837616c1007bd9fd1bcf9532ba71e
MD5 8de79e94f6da21dac72334641b2c1aa7
BLAKE2b-256 35ebc945f7e682a5f84911dd1cfe37d3fd016254e968b4952e93577ed29e3c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 021092dee4e467f72ade723bfc5b6b6d5108f58e8d139fabf1d6c246a017a0df
MD5 8e12839df9ad8df799f7473f42bdba68
BLAKE2b-256 a6eda459ddb2d23e209e057c6f4bfdd573497940dec12db44d158a426034c406

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c8c016109b9851c6c824e552cee85a734b298a1657208665f82d02fb72467249
MD5 64236a2f80947d097d61e22fd837f705
BLAKE2b-256 732e037d044f09b8804519989f0e27f6156e7bcd4df765ad18f6cd5625f4942c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8a2dc61404d2417d0500e6be7450c61d60b23c102e806ce88db1a402dc15f2d5
MD5 907bcaf6f2a68ec4ee56faaea53238e4
BLAKE2b-256 b692ad15218aa8585e9ca951010f1505e604ef20937060c3683b366d3c64344e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-package-release.yml on Gatech-Flash/huge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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