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.0
bash scripts/release.sh 2.0.0

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.0.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.0-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.0-cp314-cp314-macosx_26_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

pyhuge-2.0.0-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.0-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.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: pyhuge-2.0.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyhuge-2.0.0.tar.gz
Algorithm Hash digest
SHA256 bcd67b05e524728416f87ab86f6c8bff1600ec6bd6c2cf40752859bb548e3d4d
MD5 c357f5fef24b11c4ccaa20787766f42c
BLAKE2b-256 45a5cf00cdf62ceac080176812145ef90574076bfcdb7e3547a35bbcf0a7a2fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f1209a3170350ab338e244db82bee387d55082808105c003c4a9cb36944d7d33
MD5 b19a3e2a78c753e128b0996edcdbd2df
BLAKE2b-256 73c06b894e8c18823859ef91942ba310218900287da51fe736d4d21299491d0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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.0-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 19dd9e40b81aae8a46f9cd63a1bd4bb11b1ab800f24b96c0b2e8adcc1fc1e1af
MD5 3ab65c0ad2f8a995eaff626e2f307139
BLAKE2b-256 711c62c7dcda427a32257cbbef0191f5c164bf8a8831bce8f1c7646d4224ec9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a6bc6f339b4abd65f879ae98b451e64654ecdcf993ab26ef8faecf90d069648
MD5 f8e19cf3208c77243ccf291cdaf08f4c
BLAKE2b-256 4aab5d427a33e7889d0913e397c2ceb6f3af11b2d68b28b4acd825dab958cef4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87ee328e3ad3cfbc900e06ae53fec9b0c8f96ec66ae642816a0893322f39fd0e
MD5 2a84c418aca6e2622ea4c38b670f8691
BLAKE2b-256 adbf4cce6a4f55d5feb8a5830180258ca01b8cf9d03ee1728190ac98d10533b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5931178d5c87e8009be4448db6f227fe73973827318d4e62eac7dea76871babd
MD5 34eb30340f17ad53fa8a5b2640fbb122
BLAKE2b-256 08645397cfbc958cae37f6d5af23bea45341415b1ef7945f895137d33861c333

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd3c2aeb2958f80f1af2536aba0da2a6e60f7d09a82dcd3829c1167527101fd7
MD5 0e1bad35b73c5f3a4213093f635c4794
BLAKE2b-256 19dd35b2f1b8a1a7035cb33f2d67260117540c1bdd3bfade220ea3ec52db8855

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyhuge-2.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a40bb37c051bd6d26647d1c70922f84af81db72d3f172afb01c53efe8feb6c1f
MD5 66f30c4647beebc541c9ec6391705711
BLAKE2b-256 7848db66921b82b62adcdb6582eb8b676855a6e7ed4ed79178e3d4a5aaf5a460

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhuge-2.0.0-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