Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

get_marginal_ll not implemented for perturbation example model #93

Open
ajaynadig opened this issue Jun 6, 2024 · 0 comments
Open

get_marginal_ll not implemented for perturbation example model #93

ajaynadig opened this issue Jun 6, 2024 · 0 comments

Comments

@ajaynadig
Copy link

Hello,
Thank you for your great work on this package. I am interested in computing the log-likelihood for unseen observation given a trained scGen model. However, I found that using get_marginal_ll throws an error "marginal_ll is not implemented for current model. Please raise an issue on github if you need it.", and appears to do so as well for the perturbation tutorial:

import logging
import scanpy as sc
import scgen

train = sc.read("train.h5ad") #Kang interferon dataset
train_new = train[~((train.obs["cell_type"] == "CD4T") &
                    (train.obs["condition"] == "stimulated"))].copy()

scgen.SCGEN.setup_anndata(train_new, batch_key="condition", labels_key="cell_type")

model = scgen.SCGEN(train_new)

model.train(
    max_epochs=100,
    batch_size=32,
    early_stopping=True,
    early_stopping_patience=25
)

likelihoods = model.get_marginal_ll(return_mean = False)

Which gives this error:
NotImplementedError: marginal_ll is not implemented for current model. Please raise an issue on github if you need it.

I realize this may be an issue with scvi-tools rather than scGen, but in any case, it would be very helpful to have easy access to log-likelihoods for scGen models, both to interpret models and for methods development on top of scGen.

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant