API reference
Local metrics and dataset evaluation
Signatures, parameters, return contracts, and source for local metrics and dataset evaluation.
Module contract
These local utility functions support RMSE, AUC, and dataset evaluation. AxoBench introduces and implements the report’s Mean F1, Voltage SERA, and Dynamics SERA protocol; use axosim-evaluate-model for that core metric set. SERA uses squared error; Root-SERA is its square-root presentation.
Source revision: 306a51ed950b. Public export index.
soma_rmse
soma_rmse(prediction: np.ndarray, target: np.ndarray) -> float
| Parameter | Type | Default |
|---|---|---|
prediction |
np.ndarray |
required |
target |
np.ndarray |
required |
Returns float.
binary_auc
binary_auc(scores: np.ndarray, labels: np.ndarray) -> float
| Parameter | Type | Default |
|---|---|---|
scores |
np.ndarray |
required |
labels |
np.ndarray |
required |
Returns float.
spike_auc
spike_auc(prediction: np.ndarray, target: np.ndarray) -> float
| Parameter | Type | Default |
|---|---|---|
prediction |
np.ndarray |
required |
target |
np.ndarray |
required |
Returns float.
evaluate_dataset
evaluate_dataset(model: BranchELM, dataset: ShardedNeuronIODataset, *, batch_size: int=8, device: str='cpu', soma_units: str='millivolts', y_train_soma_scale: float=DEFAULT_Y_TRAIN_SOMA_SCALE, ignore_start: int=0, mask_mode: str='ignore-start', stitch_burn_in: int=150, soma_affine_calibration: bool=False, pin_memory: bool=False, non_blocking: bool=True) -> dict[str, float | int]
| Parameter | Type | Default |
|---|---|---|
model |
BranchELM |
required |
dataset |
ShardedNeuronIODataset |
required |
batch_size |
int |
8 |
device |
str |
'cpu' |
soma_units |
str |
'millivolts' |
y_train_soma_scale |
float |
DEFAULT_Y_TRAIN_SOMA_SCALE = 0.1 |
ignore_start |
int |
0 |
mask_mode |
str |
'ignore-start' |
stitch_burn_in |
int |
150 |
soma_affine_calibration |
bool |
False |
pin_memory |
bool |
False |
non_blocking |
bool |
True |
batch_size: Examples processed per batch. device: Execution or allocation device. ignore_start: Initial native timesteps excluded by the declared path.
Returns dict[str, float \| int].
write_metrics
write_metrics(metrics: dict[str, float | int], output: str | Path) -> None
| Parameter | Type | Default |
|---|---|---|
metrics |
dict[str, float | int] |
required |
output |
str | Path |
required |
Returns None.