Skip to main content
Python: NimbusSTS | Julia: not available
Mathematical model: a softmax emission over the features plus a latent state tracked by an extended Kalman filter (EKF)
NimbusSTS is the one head with a memory. Beside the usual “features → class” map it keeps a latent state z that evolves from trial to trial, so it can follow a class-prior that shifts with fatigue, electrode impedance, or a new day — without refitting the whole head. That state is the only thing that is filtered; the emission weights are point estimates trained by SGD.
Python head: standalone NimbusSTS, streamed through StreamingSession in STS mode. Personalizer does not ship it as a head= value; it is the classical path for non-stationary sessions. See Personalizer.

Quick start

When to use NimbusSTS

  • A long session — thirty minutes or more — with fatigue or impedance drift.
  • Cross-day experiments where electrode positions move and you want to carry state over.
  • Delayed-feedback loops: predict on the prior, update when the label arrives.

When not to use it

  • Stationary data. A state costs trials to track and parameters to tune; NimbusLDA is faster and simpler.
  • You need the fastest inference. The EKF step is not free; NimbusLDA is.
  • You need epistemic uncertainty. Only z carries a posterior. BALD, predict_proba_samples and Personalizer mc_samples raise NotImplementedError on this head. For active learning use entropy / margin / least_confidence, or switch to LDA, QDA or Softmax.
  • A single-pass learner. fit runs the EKF over the full training sequence, so this is a batch trainer despite the “streaming” framing.

Model

z captures what persists across samples — a slowly turning class-prior or logit bias. During training the EKF updates z from the labels, and emission gradients use the one-step prediction so the current label does not leak into its own regressor. During inference, propagate_state() advances the prior without a label.
Not a fully Bayesian head. The emission weights W, H and b are SGD point estimates. Only z is a Gaussian filter posterior.
The categorical label is treated as a Gaussian observation — the EKF linearizes the softmax at the current state (innovation y_onehot − p). This is a known heuristic, not a principled filter for a categorical likelihood: for low-dimensional states and slowly-varying priors it is reasonable, for high-dimensional states or sharp posterior changes it can be biased. A particle or point-mass filter over the categorical likelihood is the principled alternative.

Hyperparameters

transition_cov is the one to tune. Smaller is a slower drift (multi-day stability, short sessions); 0.01 is within-session adaptation; larger is a fast-moving environment such as mobile recording with changing impedance. Start at the default and move an order of magnitude at a time.

State: the API

A time-ordered loop with delayed feedback

In a real BCI the label is not available at prediction time. Predict on the prior, update when feedback arrives:
Without the propagate_state() call a stream is scored as if every trial were independent — clf.score(X_stream, y_stream) does exactly that, and is the baseline to beat.

Carrying state into the next session

Start day 2 from an informed prior, widened so it can adapt:
The day-2 calibration must contain every class: state_dim defaults to n_classes − 1, so a calibration that is missing a class gives the new head a smaller state and set_latent_state refuses the transfer on the shape. If day 2 cannot label every class up front, pass the same explicit state_dim to both heads.

Streaming

StreamingSession runs in STS mode when you hand it the fitted NimbusSTS estimator (not its .model_): every process_chunk advances the latent state by one step first, and a late label can be fed back through provide_feedback.
The order is the one that matters in a real loop: provide_feedback goes between the last process_chunk and finalize_trial. finalize_trial clears the trial, so a feedback call after it raises; its own label= argument only fills the result’s calibration readout and does not touch the model. finalize_trial resets the trial for you, and neither method resets the latent state — that is clf.reset_state(). Chunk sizes, aggregation and the bridge to BrainState: Python streaming inference.

Model selection context

No preregistered cell has read NimbusSTS against the other heads; it is shipped as a capability, not as an accuracy claim. What has been measured head against head: Evidence.

Next read

Python streaming inference

StreamingSession in STS mode, chunk sizes and aggregation.

Online Safety Layer

Governing partial_fit with budgets, drift monitors and rollback.

NimbusLDA

The default head, when the data does not drift.

API Reference

The full NimbusSTS signature.