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.1.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.1.0
File Size Uploaded Provenance Actions
metalc-0.1.0.tar.gz 473.2 kB Without provenance Details for metalc-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 539.0 kB

Release files / metalc-0.1.0.tar.gz

Download URL metalc-0.1.0.tar.gz
Size 473.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f73357beb927aaf576a238b10208595ce38c05185c28f4d4ad6d8577db58e946
BLAKE2b-256 checksum
How to use checksums
643e2433024eb4b9d67f07f5a22320b6770f9bacb8fbc351edddf855c5067c67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

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

Download URL metalc-0.1.0-py3-none-any.whl
Size 65.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
998722e69a97d57ecdf58e8d5e73d0755b42fa21fea372346607a1092e9f3f46
BLAKE2b-256 checksum
How to use checksums
9c9978329813096780fc1b3a54048a5160fc76eabe677087a150dba0aa60a049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Security for metalc 0.1.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.1.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