Skip to main content

Salamander is a non-negative matrix factorization framework for signature analysis

Project description

Salamander

Python versions supported License Code style

Salamander is a non-negative matrix factorization (NMF) framework for signature analysis. It implements multiple NMF algorithms, common visualizations, and can be easily customized & expanded.


Installation

PyPI:

pip install salamander-learn

Usage

The following example illustrates the basic syntax:

import pandas as pd
import salamander

# samples and features have to be named appropriately
data_path = "..."
data = pd.read_csv(data_path, index_col=0)

# NMF with a Poisson noise model
model = salamander.KLNMF(n_signatures=5)
model.fit(data)

# barplot
model.plot_signatures()

# stacked barplot
model.plot_exposures()

# signature correlation
model.plot_correlation()

# sample_correlation
model.plot_correlation(data="samples")

# dimensionality reduction of the exposures
# method: umap, pca or tsne
model.plot_embeddings(method="umap")

For examples of how to customize any NMF algorithm and the plots, check out the tutorial. The following algorithms are currently available:

License

MIT

Changelog

Consult the CHANGELOG file for enhancements and fixes of each version.

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

salamander_learn-0.3.1.tar.gz (33.4 kB view hashes)

Uploaded Source

Built Distribution

salamander_learn-0.3.1-py3-none-any.whl (41.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page