Skip to main content

metalc

metalc

MetaLC implement a robust mixed-membership model and lets domain knowledge into the loop: ensemble topics are pooled and clustered into stable meta-LCs, which you then use to build a model that describes your data.

Install

pip install metalc

Usage

import metalc as mlc

1. Fit an ensemble

Supports LDA and NMF.

ensemble = mlc.run_ensemble(df, [2, 10], method="lda",
                            taxonomy=taxa_df,      # feature-indexed; annotation only
                            cache_dir=".../lda_ensemble_results")

2. Select a layer and look at it

ensemble.layers()
e = ensemble[2]

mlc.plot_meta(e, view="profile", rank="Genus", profile="medoid", coherence=True)
mlc.plot_meta(e, view="umap",    rank="Genus", profile="medoid")

3. Freeze the meta-LCs and infer H

result = mlc.inference(e, metadata, meta_lc_list=[0, 3, 4], profile="medoid")
result.H   # samples x meta-LC, rows sum to 1
result.W   # meta-LC x feature (the frozen dictionary)

Metadata

Release files for metalc 0.2.0

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

Source distribution (sdist)

Source distribution for metalc 0.2.0
File Size Uploaded Provenance Actions
metalc-0.2.0.tar.gz 480.9 kB Without provenance Details for metalc-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metalc 0.2.0
File Interpreter ABI Platform Actions
metalc-0.2.0-py3-none-any.whl Python 3 none any Details for metalc-0.2.0-py3-none-any.whl

Total release size: 554.7 kB

Release files / metalc-0.2.0.tar.gz

Download URL metalc-0.2.0.tar.gz
Size 480.9 kB
Tags Source
SHA-256 checksum
How to use checksums
df4bc11133b7dd6785ceab2ff7b1faad4ab2479ba3eb6625b171a80d5faf8f22
BLAKE2b-256 checksum
How to use checksums
5a754bf63acfc3744271040bed457db78ebb128e8839d7de6f15b70969006b93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Release files / metalc-0.2.0-py3-none-any.whl

Download URL metalc-0.2.0-py3-none-any.whl
Size 73.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e9f41c7acef8625177183c3e114bf383d37c38108901735be9c9e00bbb21051
BLAKE2b-256 checksum
How to use checksums
2c251a067017a245b6a0ae1bdf61ebb3e96d70d06d37e4564b1228d80316fbe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Security for metalc 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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