Salamander is a non-negative matrix factorization framework for signature analysis
Project description
Salamander
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.0.tar.gz
(32.7 kB
view hashes)
Built Distribution
Close
Hashes for salamander_learn-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19d53518ce9406b5b4c842e473640447798dbda442780454f04b4632092da163 |
|
MD5 | b722d5090b82fa14ab84094bf9727686 |
|
BLAKE2b-256 | 7396475e5ae2edbce8fa547121e602d50577282c970ccb6ccbeee45150ee278a |