TS3ReadoutSpec#

class ibl_bwb_eval.TS3ReadoutSpec(id, label_names, region_key, metrics, target_resolution=TargetResolution.SEQUENCE)[source]#

Bases: object

What one TS3 task predicts.

id#

the task name.

label_names#

the class order every pred_proba column is indexed by. The scorer rejects a submission whose label_names disagree with the ground truth’s, so this is part of the on-disk format.

region_key#

the units field the targets are read from.

metrics#

mapping from metric name to the callable that computes it. Per task, not per suite: region classification reports P/R/F1, and a task regressing a CCF coordinate would declare error metrics instead. Each callable takes (y_true, y_pred, label_names) and returns the scored names it owns.

property dim: int#

Number of classes. Derived, so it cannot drift from label_names.

property num_timesteps: int#

a TS3 target is a unit’s label, not a time course.

Type:

Always one

score(y_true, y_pred)[source]#

Every metric this task declares, flattened.

The scorer and the probes both call this, so a run’s live scores and its offline scores cannot diverge.

Return type:

dict[str, float]