PredictionsStore#

class ethograph.labels.predictions.PredictionsStore(folder)[source]#

Bases: object

Read one ethograph.segment.inference prediction folder.

Example

store = PredictionsStore("labels/predictions_mstcn_20260101_000000")
labels_df, _ = store.load_all(dt)
confidence = store.get_confidence(trial=5, dt=dt, individual="A")

Methods

get_confidence(trial, dt[, individual])

Per-frame confidence for one (trial, individual), from the run's own probabilities.

load_all(dt[, individual])

Every trial's predictions, already postprocessed by the run itself.

get_confidence(trial, dt, individual=None)[source]#

Per-frame confidence for one (trial, individual), from the run’s own probabilities.

Returns None when the run has no .npz (e.g. a hand-edited folder) or no key matches — an aid to review, never something a caller depends on.

Return type:

ndarray | None

get_confidence_curve(trial, dt, individual=None)[source]#

(time, confidence) for one (trial, individual), on the run’s own clock.

The run may have been trained subsampled, so its curve is sparser than the session’s time coordinate: the {key}_time array written beside the probabilities is the only clock the curve can be drawn on.

Return type:

tuple[ndarray, ndarray] | None

load_all(dt, individual=None, **_ignored)[source]#

Every trial’s predictions, already postprocessed by the run itself.

Return type:

tuple[DataFrame, dict]