Native Python package for high-dimensional undirected graph estimation
Project description
pyhuge Python Package
pyhuge is a native Python package for high-dimensional undirected graph
estimation and inference workflows inspired by huge.
Quick links
- PyPI: https://pypi.org/project/pyhuge/
- Documentation home: https://gatech-flash.github.io/huge/
- Getting started: https://gatech-flash.github.io/huge/getting-started/
- Installation: https://gatech-flash.github.io/huge/installation/
- API reference: https://gatech-flash.github.io/huge/api/
- Function manual index: https://gatech-flash.github.io/huge/man/index/
- Changelog: https://gatech-flash.github.io/huge/changelog/
Background
Compared with the earlier rpy2-bridge line, pyhuge runs natively in
Python and does not require an R runtime.
Directory structure
pyhuge/: package source codepyhuge/data/: packaged datasets (stockdata.npz)cpp/: optional pybind11 acceleration kernelstests/: unit/e2e/parity testsexamples/: runnable scriptsdocs/: MkDocs documentation pagesscripts/: 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,scikit-learn
Optional:
- plotting:
matplotlib,networkx - docs:
mkdocs,mkdocs-material
Installation
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
If native C++ acceleration cannot be built on your machine, pyhuge falls back
to pure Python automatically.
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)
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 <major.minor.patch>
bash scripts/release.sh <major.minor.patch>
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}
}
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
File details
Details for the file pyhuge-0.3.3.tar.gz.
File metadata
- Download URL: pyhuge-0.3.3.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1767637d25533dd21f6b1ebe46865db9870de848c74cbe33f30c50539cbc834
|
|
| MD5 |
e4751c196d73cc103a6ed5d53fb0be9f
|
|
| BLAKE2b-256 |
f0f530f8c66d6601e2cea9f1c1f540d35eac0e0632f8dc11d516b5e97f2b8e37
|
Provenance
The following attestation bundles were made for pyhuge-0.3.3.tar.gz:
Publisher:
python-package-release.yml on Gatech-Flash/huge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhuge-0.3.3.tar.gz -
Subject digest:
f1767637d25533dd21f6b1ebe46865db9870de848c74cbe33f30c50539cbc834 - Sigstore transparency entry: 995368972
- Sigstore integration time:
-
Permalink:
Gatech-Flash/huge@d6e0b3f805cd99156c7be98a091b49a14a75b869 -
Branch / Tag:
refs/tags/pyhuge-v0.3.3 - Owner: https://github.com/Gatech-Flash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package-release.yml@d6e0b3f805cd99156c7be98a091b49a14a75b869 -
Trigger Event:
push
-
Statement type: