TrailingMean#

class ts2.models.single_session.TrailingMean(k=None)[source]#

Bases: ts2.models.single_session.stat_baseline.base.StatBaseline

Trailing-window mean, held flat over the horizon.

Parameters:

k (Optional[int]) – trailing-window length (bins). None selects on val over K_GRID.

fit(train_dataset, val_dataset)[source]#

Fit on train, select hyperparameters on val, and record val_score.

Subclasses pull what they need via _windows() or off the dataset. The mean rate needs neither, so this is a no-op and the default val_score already covers it (see MeanRate).

predict(spikes, **_)[source]#

Log-rates (B, T, N).

At test the held-out entries are already zeroed, so the observed population / past is exactly the non-masked data.

Return type:

Tensor