chemCPA icon indicating copy to clipboard operation
chemCPA copied to clipboard

predict.py takes a pretrained model and yields predictions

Open B1RO opened this issue 11 months ago • 1 comments

model.py:

  • latent drug embedding computation has been refactored, so that it consists of two steps: a) precomputed embedding lookup b) transformation into latent space
  • compute_covariate_embeddings_ - one-hot-covariates -> into latent space representation predict.py : new file, contains a predict function, that takes in gene expression data, drug embeddings, covariates, and a checkpoint, and returns predictinos of length correspond to cartesian product. this fie also contains example prepare script that shows how to do this for lincs, including combinatorial data.

note: the predict.py has too big of a scope, and will need a bit more refactoring later. in the end, predict.py should probably just contain the predict fn,and the example loading should move to a notebook.

B1RO avatar Feb 06 '25 15:02 B1RO

Hello, very good work; I recently tried to use your model to predict new data sets, but there seems to be no way to save preds directly inside the code. I'm glad you will update predcit.py later, but what I don't understand about this method is: Are "cached_control_genes.pt "and" cached_random_drug_embeddings.pt" generated when the model is training? I don't seem to have produced these two files when I train the model

Susan920715 avatar Feb 26 '25 10:02 Susan920715