Package for Statistical Components for Underlying Dimensions.
Installing
pip install scud
Documentation
The documentation can be found here.
Getting Started
The getting started can be found here.
Quick start
Import package and load data
from scud import PlnPCA, BinPCA
from scud.data import load_scrna
data_and_labels = load_scrna(return_labels = True)
counts = data_and_labels['endog']
labels = data_and_labels['labels']
Instantiate, fit the model and visualize the results for the Binomial PCA model
binpca = BinPCA(data = counts, latent_dimension = 5)
binpca.fit()
binpca.viz(colors = labels)
Instantiate, fit the model and visualize the results for the Poisson-log Normal PCA model
plnpca = PlnPCA(data = counts, latent_dimension = 5)
plnpca.fit()
plnpca.viz(colors = labels)
Supervised learning using labels
One hot encode the labels
from sklearn.preprocessing import OneHotEncoder
import numpy as np
labels = np.array(labels).reshape(-1, 1)
encoder = OneHotEncoder()
exog = encoder.fit_transform(labels).toarray()
additional_data = {"exog": exog}
Instantiate and fit the PlnPCA model
plnpca = PlnPCA(data = counts, latent_dimension = 5, additional_data = additional_data)
plnpca.fit()
plnpca.viz(colors = labels.reshape(-1))
Instantiate and fit the BinPCA model
binpca = PlnPCA(data = counts, latent_dimension = 5, additional_data = additional_data)
binpca.fit()
binpca.viz(colors = labels.reshape(-1))
CONTRIBUTING
You should run pre-commit install in the repo directory before commiting (if pre-commit is not installed,
you can pip install it). This will make sure each python file is well
formated and pylint will check the code before any python file is committed. You can check the .pre-commit-config.yaml file for more details on pylint configuration.
🛠 Installation
⚡️ Citations
Please cite our work:
Batardière, Bastien, Joon Kwon, Julien Chiquet, and Julien Stoehr (2024). “Importance sampling based gradient method for dimension reduction in Poisson Log-Normal model.” In: arXiv. url: https://arxiv.org/abs/2410.00476.
Metadata
Release files for scud 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scud-0.0.6.tar.gz | 351.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scud-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 445.7 kB
Release files / scud-0.0.6.tar.gz
| Download URL | scud-0.0.6.tar.gz |
|---|---|
| Size | 351.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a823d0b9ae1b48bdc218a2897895c373a49b26b1927a52db218e401f3970ddc
|
|
BLAKE2b-256 checksum How to use checksums |
b5f62d78198bb976b4ffd68b1f9ecdce0e2e1277a864f065247280b2b4244254
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.15
|
Release files / scud-0.0.6-py3-none-any.whl
| Download URL | scud-0.0.6-py3-none-any.whl |
|---|---|
| Size | 94.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
416703064c58bffe9497498e9282689c96912484f136959f5189eb04ff7319e0
|
|
BLAKE2b-256 checksum How to use checksums |
f8c43a158916fea6fd9b9626511696985df3887e7668be9eb273298ed0db9ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.15
|