seqme.metrics.Subset

seqme.metrics.Subset#

class seqme.metrics.Subset(metric, *, n_samples, seed=0)[source]#

A wrapper to approximate expensive metrics by evaluating a subset of the sequences in a group.

__init__(metric, *, n_samples, seed=0)[source]#

Initialize subset wrapper.

Parameters:
  • metric (Metric) – Metric to compute.

  • n_samples (int) – Number of sequences to sample.

  • seed (int) – Seed for deterministic sampling.

__call__(sequences)[source]#

Compute the metric on a subset of sequences.

Parameters:

sequences (list[str]) – Sequences to sample a subset from and evaluate.

Returns:

Metric computed on a subset of the sequences.

Return type:

MetricResult

Methods

__init__(metric, *, n_samples[, seed])

Initialize subset wrapper.

__call__(sequences)

Compute the metric on a subset of sequences.

Attributes

name

Name of the metric.

objective

Whether lower or higher scores indicate better performance.