RidgeAR#

class ts2.models.single_session.RidgeAR(window_length=None, ridge_lambda=None)[source]#

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

Per-unit ridge autoregression from the observed bins to the horizon.

Parameters:
  • window_length (Optional[int]) – autoregression window length (bins). None selects on val over AR_L_GRID.

  • ridge_lambda (Optional[float]) – ridge strength. None selects on val over AR_LAMBDA_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