seqme.metrics.ID

seqme.metrics.ID#

class seqme.metrics.ID(predictor, name, objective, *, deviation='se', estimate='unbiased')[source]#

Applies a user-provided predictor to a list of sequences and returns the mean and standard error of the predictors outputs.

__init__(predictor, name, objective, *, deviation='se', estimate='unbiased')[source]#

Initialize the metric.

Parameters:
  • predictor (Callable[[list[str]], ndarray]) – A function that takes a list of sequences and returns a 1D array of scalar values.

  • name (str) – Name of the metric.

  • objective (Literal['minimize', 'maximize']) – Specifies whether lower or higher values of the metric are better.

  • deviation (Literal['std', 'se', 'var']) –

    Type of deviation to compute:

    • 'std': Standard deviation

    • 'se': Standard error

    • 'var': Variance

  • estimate (Literal['biased', 'unbiased']) – How to estimate the deviation.

__call__(sequences)[source]#

Evaluate the predictor on the provided sequences.

Applies the predictor to the sequences and returns the mean and standard error of the resulting values (if more than one sequence).

Parameters:

sequences (list[str]) – Sequences to evaluate.

Returns:

Mean predictor value and deviation.

Return type:

MetricResult

Methods

__init__(predictor, name, objective, *[, ...])

Initialize the metric.

__call__(sequences)

Evaluate the predictor on the provided sequences.

Attributes

name

Name of the metric.

objective

Whether lower or higher scores indicate better performance.