Metrics (evaluate)¶
Score an embedding with the paper's metrics. The scores come as the long
table that mtb.load_results returns. The
API overview summarises the metrics=
selector.
| Name | Summary |
|---|---|
mtb.evaluate |
Score an embedding with the benchmark's metrics. |
mtb.evaluate
¶
evaluate(
embedding,
labels=None,
*,
dataset: str | None = None,
method: str = "embedding",
category: str | None = None,
batch=None,
metrics=None,
obsm: str | None = None,
verbose: bool = True,
) -> DataFrame
Score an embedding with the benchmark's metrics.
The protocol is the paper's: Leiden clusters searched to the number of cell types for ARI, NMI, ASW, iASW and iF1, and to the number of batches for ARI_batch and NMI_batch.
| PARAMETERS | DESCRIPTION |
|---|---|
embedding
|
Cells x dims: an array, DataFrame, AnnData or MuData (
|
labels
|
One cell type per cell: CSV path(s), a 1-D array-like, or an
default
|
dataset
|
The dataset folder, a name or a path; its name fills the
type
|
method
|
Fills the
type
|
category
|
type
|
batch
|
One batch per cell, in the forms
default
|
metrics
|
type
|
obsm
|
type
|
verbose
|
Print a line when the Leiden search starts on more than 2,000 cells.
type
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
The long table: |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
Missing or misaligned labels or batches, an unknown category or metric, or batch or classification metrics without batch labels. |
FileNotFoundError
|
An embedding, label file or dataset folder that does not exist. |
Examples