Skip to main content

Sparse factor model estimation with sign-constrained LASSO, prior-centered regularisation, and hierarchical group LASSO (HCGL)

Project description

factorlasso 0.2.0 — Release Bundle

This bundle contains the three source files that need to be committed to the repo for the 0.2.0 release, plus the built distribution artefacts.

Contents

File Where it goes What changed
__init__.py factorlasso/__init__.py Rewritten to export the 5 cluster utilities from cluster_utils
.gitignore repo root Fixed .idea/ exclusion; expanded Python project ignores
pyproject.toml repo root Version bumped 0.1.12 → 0.2.0
factorlasso-0.2.0-py3-none-any.whl dist/ Fresh wheel build (includes cluster_utils.py)
factorlasso-0.2.0.tar.gz dist/ Fresh sdist build

What verified

Against the full repo state (cluster_utils.py + updated init.py + all other modules):

  • python -m pytest tests/143 passed, 9 skipped (skipped are environment-specific)
  • python tests/test_integration.py → runs end-to-end
  • ✓ Fresh wheel builds cleanly via python -m build --wheel --sdist
  • ✓ Installing from the fresh wheel and re-running all tests → all pass
  • from factorlasso import get_clusters_by_freq, get_linkages_by_freq, get_cutoffs_by_freq, get_linkage_array, compute_clusters_from_corr_matrix → all importable
  • ✓ Round-trip HCGL ≡ GROUP_LASSO-with-external-clusters semantic test passes
  • .gitignore correctly excludes .idea/*, __pycache__/, build artefacts

Version bump rationale (semver)

0.1.12 → 0.2.0 because the release adds new public API:

  • get_clusters_by_freq (new)
  • get_linkages_by_freq (new)
  • get_cutoffs_by_freq (new)
  • get_linkage_array (promoted from internal to public export)

Plus a module-level reorganisation (all clustering utilities consolidated into the new factorlasso.cluster_utils module). The existing public API is fully preserved — compute_clusters_from_corr_matrix is still importable from factorlasso top-level exactly as before.

One manual cleanup step needed in your working copy

The .idea/ directory was previously committed (the old .gitignore had *.idea/ which doesn't match .idea/). Updating .gitignore alone won't untrack what's already in git. Run this once:

git rm -r --cached .idea/
git commit -m "chore: untrack .idea IDE metadata"

After that, future changes to .idea/ files will be ignored correctly.

Suggested commit structure

Three logical commits:

# 1. Code reorganisation (already in your repo — cluster_utils.py, the
#    updated lasso_estimator.py and factor_covar.py)
git add factorlasso/cluster_utils.py factorlasso/lasso_estimator.py factorlasso/factor_covar.py
git commit -m "refactor: consolidate clustering utilities into cluster_utils module"

# 2. Public API update
git add factorlasso/__init__.py
git commit -m "feat: export cluster helpers (get_*_by_freq, get_linkage_array)"

# 3. Version bump + .gitignore fix
git add pyproject.toml .gitignore
git rm -r --cached .idea/
git commit -m "chore: bump to 0.2.0; fix .idea gitignore glob"

# 4. (optional) Rebuild dist/ if you want to commit artefacts
# Most projects don't commit dist/ — just build on release via CI

Changelog entry (for CHANGELOG.md if you have one)

## [0.2.0] - 2026-04-18

### Added
- New module `factorlasso.cluster_utils` consolidating all clustering utilities
- Public API exports: `get_clusters_by_freq`, `get_linkages_by_freq`, `get_cutoffs_by_freq`
- Public API export: `get_linkage_array` (previously internal)

### Changed
- `compute_clusters_from_corr_matrix` moved from `lasso_estimator.py` to `cluster_utils.py`
  (still importable from top-level `factorlasso`)
- `get_linkage_array` moved from `factor_covar.py` to `cluster_utils.py`
- `LassoModel` with `model_type=GROUP_LASSO` now populates `.clusters_` attribute from
  externally-supplied `group_data`, for API uniformity with HCGL mode

### Fixed
- `compute_clusters_from_corr_matrix` now uses `squareform(1 - C)` (correct correlation-to-distance
  conversion) instead of the previous buggy `pdist(1 - C)` (which computed Euclidean distances
  between rows of the correlation matrix)
- `.gitignore` glob `*.idea/` corrected to `.idea/`

### Internal
- All 143 existing tests continue to pass
- Wheel now correctly includes `cluster_utils.py`

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

factorlasso-0.2.2.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

factorlasso-0.2.2-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file factorlasso-0.2.2.tar.gz.

File metadata

  • Download URL: factorlasso-0.2.2.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for factorlasso-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9961704b23810f58c129054e57434567e43b0641daf3032f47e53d9d519a2f1c
MD5 12752f1732d1885e74fb10d4531ab201
BLAKE2b-256 b3d0aa39d3d56ed8262cf3f1319ca889f6053c10ffde379e8e557c17573f9ab4

See more details on using hashes here.

File details

Details for the file factorlasso-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: factorlasso-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for factorlasso-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a87c1458aa184d3f0702dffdcd49c0940287a9f3fc1f22c56ab94c1a8abb8f
MD5 a27293980cb5ffccb20007d428be8d93
BLAKE2b-256 6a56f71e7fc0ca941b7e1b95f621a02c3f813a394d52ef695ca2f1faead1c2c8

See more details on using hashes here.

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