popv.hub.HubModelCardHelper#

class popv.hub.HubModelCardHelper(license_info, anndata_version, scikit_learn_version, organism, tissues=<factory>, cellxgene_url=None, description='To be added...', references='To be added...', metrics_report=None, training_code_url='Not provided by uploader.')[source]#

A helper for creating a ModelCard for popV hub models.

Parameters:
  • license_info (str) – The license information for the model.

  • scvi_version – The version of scvi-tools that the model was trained with.

  • anndata_version (str) – The version of anndata used during model training.

  • scikit_learn_version (str) – The version of scikit-learn used during model training.

  • organism (str) – The organism of the data.

  • tissues (list[str] (default: <factory>)) – The tissues of the training data.

  • cellxgene_url (str | None (default: None)) – Link to the data in the CELLxGENE portal.

  • description (str (default: 'To be added...')) – A description of the model.

  • references – A list of references for the model.

  • metrics_report (str | None (default: None)) – A dictionary containing the metrics report for the model.

model_card#

Stores the model card.

Type:

ModelCard

Notes

It is not required to use this class to create a ModelCard. But this helps you do so in a way that is consistent with other popV hub models. You can think of this as a template. The resulting huggingface ModelCard can be accessed via the model_card property.

Attributes table#

Methods table#

from_dir(local_dir, license_info, ...[, ...])

Create a HubModelCardHelper object from a local directory.

Attributes#

HubModelCardHelper.cellxgene_url: str | None = None#
HubModelCardHelper.description: str = 'To be added...'#
HubModelCardHelper.metrics_report: str | None = None#
HubModelCardHelper.references: str = 'To be added...'#
HubModelCardHelper.training_code_url: str = 'Not provided by uploader.'#
HubModelCardHelper.license_info: str#
HubModelCardHelper.anndata_version: str#
HubModelCardHelper.scikit_learn_version: str#
HubModelCardHelper.organism: str#
HubModelCardHelper.tissues: list[str]#

Methods#

classmethod HubModelCardHelper.from_dir(local_dir, license_info, anndata_version, scikit_learn_version, organism, metrics_report=None, **kwargs)[source]#

Create a HubModelCardHelper object from a local directory.

Parameters:
  • local_dir (str) – The local directory containing the model files.

  • license_info (str) – The license information for the model.

  • anndata_version (str) – The version of anndata used during model training.

  • scikit_learn_version (str) – The version of scikit-learn used during model training.

  • organism (str) – The organism of the data.

  • metrics_report (str | None (default: None)) – Path to the json with stored metrics report.

  • data_is_minified – Whether the training data uploaded with the model has been minified.

  • kwargs – Additional keyword arguments to pass to the HubModelCardHelper initializer.