sakura.sakuraAE.sakuraAE.test

sakuraAE.test(split_id, test_main=True, test_pheno=True, selected_pheno=None, test_signature=True, selected_signature=None, make_logs=False, log_prefix='test', log_loss_groups=['loss', 'regularization'], dump_latent=True, latent_prefix='', dump_pre_encoder_output=False, dump_reconstructed_output=False, reconstructed_output_naming='dimid', dump_predicted_phenos=False, dump_predicted_signatures=False, compression='none', save_raw_loss=False)

Test all latents of the model, with options to evaluate specific loss groups and dump selected latents.

Parameters:
  • split_id (str) – id of the split to be used in this test

  • test_main (bool, optional) – Whether to forward the main latent space part during testing, defaults to True

  • test_pheno (bool, optional) – Whether to forward phenotype side tasks during testing, defaults to True

  • selected_pheno* – Phenotype id(s) used for phenotype side tasks during testing, selected phenotype(s)

  • test_signature (bool, optional) – Whether to forward gene signature side tasks during testing, defaults to True

  • selected_signature* – Similar to selected_pheno, but for signature side tasks during testing

  • make_logs (bool, optional) – Should information, including losses be logged, defaults to True

  • log_prefix (str, optional) – Prefix of testing log (for losses, this prefix will be added first to the item name in tensorboard and filename of latent embeddings), defaults to ‘test’

  • log_loss_groups (list[str], optional) – Selected loss(es) group to be logged, defaults to [‘loss’, ‘regularization’]

  • dump_latent (bool, optional) – Should all latent space representations be dumped after each batch, defaults to True (only cells within the split will be dumped)

  • latent_prefix (str, optional) – Prefix to be added after <log_prefix> to latent embedding filename

  • dump_pre_encoder_output (bool, optional) – Whether to export output of the pre-encoder module, defaults to False

  • dump_reconstructed_output (bool, optional) – Whether to export output of the reconstruction module, defaults to False

  • reconstructed_output_naming (Literal['dimid', 'genenames'], optional) – Set the column names of the reconstructed matrix, can be ‘dimid’ (by default) which means dimension id or ‘genenames’ (names of genes)

  • dump_predicted_phenos (bool, optional) – Whether to dump predicted phenotype output, defaults to False

  • dump_predicted_signatures (bool, optional) – Whether to dump predicted signature output, defaults to False

  • compression (Literal['hdf', 'gzip','none'], optional) – compression type of CSV files, can be ‘hdf’, ‘gzip’ or ‘none’ (by default)

  • save_raw_loss (bool, optional) – Whether to record raw losses, defaults to False

Note

The selected_pheno (selected signature) should be configured and stored in self.selected_pheno (self.selected_signature). If it is set to None, self.selected_pheno (self.selected_signature) will act as the default, which means that all selected phenotypes (or signatures) will be tested. This feature is designed for complex testing scenarios where the computation model is partially forwarded (i.e. some of the forward flags being set to False).

Returns:

None