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}
}

Release files for pyhuge 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyhuge 2.0.1
File Size Uploaded
pyhuge-2.0.1.tar.gz 1.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyhuge 2.0.1
File
pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details

Total release size: 94.7 MB

Release files / pyhuge-2.0.1.tar.gz

Download URL pyhuge-2.0.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
b44308832d95e51b2ebff76c64866e95e630990f510894b1f1044652fab4dca7
BLAKE2b-256 checksum
How to use checksums
2fb66792ab981bdd90d1cb3622f949f170e6f7fa7a5df6f566f8747be1a1a629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4021cce2873645bf179e4c6ff8fb855bd435a738c6df439a33a01c11001de8d2
BLAKE2b-256 checksum
How to use checksums
3e6a8308de0fdea3186fba77708dc1a84cd945de7ae263ebccdbc8c2aee42788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b20a79ca9070acf6e9bf22082b17b1a0df025e38e2adc80945ae822f9829f657
BLAKE2b-256 checksum
How to use checksums
39c089db93478fe2e5cda05488569148fdd129dd557e204fea7e526ff719cc68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9da4a8e539ac89bd665f6b8de61e185a62c837616c1007bd9fd1bcf9532ba71e
BLAKE2b-256 checksum
How to use checksums
35ebc945f7e682a5f84911dd1cfe37d3fd016254e968b4952e93577ed29e3c3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
021092dee4e467f72ade723bfc5b6b6d5108f58e8d139fabf1d6c246a017a0df
BLAKE2b-256 checksum
How to use checksums
a6eda459ddb2d23e209e057c6f4bfdd573497940dec12db44d158a426034c406
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c8c016109b9851c6c824e552cee85a734b298a1657208665f82d02fb72467249
BLAKE2b-256 checksum
How to use checksums
732e037d044f09b8804519989f0e27f6156e7bcd4df765ad18f6cd5625f4942c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyhuge-2.0.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.5 MB
Tags CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8a2dc61404d2417d0500e6be7450c61d60b23c102e806ce88db1a402dc15f2d5
BLAKE2b-256 checksum
How to use checksums
b692ad15218aa8585e9ca951010f1505e604ef20937060c3683b366d3c64344e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

7 release files

2.0.0

8 release files

0.8.1

2 release files

0.8.0

2 release files

0.3.3

1 release file

0.3.2

1 release file

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page