Documentation Index
Fetch the complete documentation index at: https://docs.nimbusbci.com/llms.txt
Use this file to discover all available pages before exploring further.
NimbusSoftmax — Bayesian Softmax Classifier
Python:NimbusSoftmax | Julia equivalent: NimbusProbitMathematical model: Bayesian multinomial logistic regression with Polya-Gamma variational inference
NimbusSoftmax is the Python SDK’s flexible non-Gaussian static classifier. Use it when NimbusLDA and NimbusQDA are too restrictive, but you still want posterior uncertainty, sklearn compatibility, and active-learning support.
Availability
- Python SDK: ✅
NimbusSoftmaxvia the optionalsoftmaxextra - Julia SDK: ❌ Use
NimbusProbitfor Julia’s non-Gaussian static classifier
Install
NimbusSoftmax depends on the optional JAX-based softmax backend:
Quick Start
When to Use NimbusSoftmax
- You are using the Python SDK and need a flexible static classifier.
- Class boundaries are non-Gaussian or not well represented by class-conditional means/covariances.
- You need uncertainty-aware outputs for rejection policies, active learning, or calibration analysis.
NimbusLDA/NimbusQDAaccuracy has plateaued on a complex multinomial task.
When Not to Use It
- If latency is the top priority: start with
NimbusLDA, thenNimbusQDA. - If class centers and Mahalanobis distance are important for interpretability or outlier diagnostics: use
NimbusLDAorNimbusQDA. - If the session is drifting over time: use
NimbusSTS. - If you are using Julia: use
NimbusProbit.
Model Architecture
NimbusSoftmax fits a Bayesian multinomial logistic regression model. It uses a reference-class parameterization, so one class has zero logits and the remaining classes are modeled relative to it.
Hyperparameters
| Parameter | Default | Description |
|---|---|---|
w_loc | 0.0 | Prior mean for feature weights |
w_scale | 1.0 | Prior scale for feature weights |
b_loc | 0.0 | Prior mean for bias terms |
b_scale | 1.0 | Prior scale for bias terms |
learning_rate | 0.2 | Damping factor for variational updates |
num_steps | 50 | Number of coordinate-ascent update sweeps |
num_posterior_samples | 50 | Posterior samples used for prediction |
rng_seed | 0 | Random seed for reproducible posterior sampling |
Usage
Train and Predict
Tune with sklearn
Online Updates
Active Learning
NimbusSoftmax supports BALD through posterior predictive samples, so it can drive label-efficient calibration loops.
Training Requirements
- Minimum: at least 2 observations are required.
- Recommended: 40+ trials per class for stable estimates.
- Feature normalization: strongly recommended for cross-session stability.
- Input shape:
(n_trials, n_features).
Performance Characteristics
| Operation | Typical cost | Notes |
|---|---|---|
| Training | Moderate | More expensive than NimbusLDA / NimbusQDA |
| Batch inference | ~15-25ms per trial | Depends on posterior sample count |
| Streaming chunk | ~15-25ms | Use lower sample counts if latency is binding |
NimbusSoftmax is usually slower than NimbusLDA and NimbusQDA, but can improve accuracy when class boundaries are not well represented by Gaussian class-conditionals.
Model Inspection
Model Selection Context
UseNimbusSoftmax when you are in Python and need a non-Gaussian static classifier with posterior sampling support. If you need explicit class centers or Mahalanobis diagnostics, use NimbusLDA or NimbusQDA. If the session drifts over time, use NimbusSTS.
For the canonical side-by-side comparison, see Model Specification.
Next Read
NimbusProbit (Julia)
Julia’s non-Gaussian static classifier.
Python API Reference
Full
NimbusSoftmax constructor and method reference.Active Learning
Use posterior samples to reduce calibration labels.
Model Selection
Compare Nimbus model families.
References
Implementation:- Python source code:
nimbus_bci/models/nimbus_softmax/innimbus-bci
- Polson, N. G., Scott, J. G., & Windle, J. (2013). “Bayesian inference for logistic models using Pólya-Gamma latent variables”
- Windle, J., Polson, N. G., & Scott, J. G. (2014). “Sampling Pólya-Gamma random variates: alternative and approximate techniques”
- Bayesian multinomial logistic regression with Polya-Gamma augmentation and variational inference