Edit on GitHub

parascape.label_metrics

Per-class numbers derived from per-gene held-out rows (instruction 64.10).

Every summary here is computed from rows of (truth, prediction), one per held-out gene, where a missing prediction is an abstention. The same function reads the 14-strategy track record (track_record.shipped) and the harness rows (harness.HarnessResult.rows), so no number exists that the rows do not support.

def by_class(rows: pandas.DataFrame) -> pandas.DataFrame:

Per true class: genes, answered, right, recall, precision of calls naming it, F1.

Recall counts an abstention as not recovered; precision counts only calls that name the class. Classes that were never predicted keep a missing precision rather than zero.

def overall(rows: pandas.DataFrame) -> dict:

Coverage, accuracy on answered genes, accuracy on all, chance (commonest class) and macro F1.

def confusion(rows: pandas.DataFrame) -> pandas.DataFrame:

True class (rows) by call (columns), with an abstained column.

def track_record_rows(ledger: pandas.DataFrame, strategy: str, target: str) -> pandas.DataFrame:

The per-gene fold hold-out rows of one strategy and label, at its first recorded setting.