Python SDK
The nimbus-bci Python library provides sklearn-compatible Bayesian classifiers for Brain-Computer Interface applications. Built on JAX and NumPyro, it delivers fast probabilistic inference with full uncertainty quantification, streaming support, and rich diagnostics.Overview
nimbus-bci is a production-ready Python package available on PyPI that brings Bayesian inference to BCI applications with a familiar sklearn-compatible API.
Key Features
sklearn Compatible
Drop-in replacement for sklearn classifiers. Works with pipelines, cross-validation, and GridSearchCV.
Streaming Inference
Real-time chunk-by-chunk processing for online BCI applications with weighted aggregation.
MNE Integration
Seamless integration with MNE-Python for EEG preprocessing and feature extraction.
Rich Diagnostics
Entropy, calibration metrics (ECE/MCE), ITR calculation, and quality assessment.
Online Learning
Update models incrementally with
partial_fit() without retraining from scratch.Fully Local
No API keys required. All processing happens on your machine for maximum privacy.
Quick Example
Available Classifiers
The Python SDK provides three Bayesian classifiers:| Classifier | Description | Best For |
|---|---|---|
| NimbusLDA | Bayesian LDA with shared covariance | Fast, well-separated classes (motor imagery) |
| NimbusGMM | Bayesian GMM with class-specific covariances | Complex distributions (P300) |
| NimbusSoftmax | Bayesian logistic regression (Polya-Gamma VI) | Non-Gaussian decision boundaries |
- Full posterior distributions
- Uncertainty quantification
- Online learning via
partial_fit() - sklearn-compatible API
Python vs Julia SDK
Both SDKs implement the same Bayesian models but with different design philosophies:| Feature | Python SDK | Julia SDK |
|---|---|---|
| Installation | pip install nimbus-bci | Pkg.add("NimbusSDK") + API key |
| API Style | sklearn-compatible classes | Functional + types |
| Integration | sklearn pipelines, MNE-Python | RxInfer.jl ecosystem |
| Performance | Fast (JAX/NumPyro) | Fastest (native Julia) |
| API Key | Not required | Required |
| Use Case | Production ML pipelines | Research, custom models |
| License | Proprietary (free evaluation) | Commercial tiers |
When to Use Python SDK
Choose the Python SDK if you:- ✅ Work primarily in Python
- ✅ Use sklearn pipelines and MNE-Python
- ✅ Want immediate installation without API keys
- ✅ Need sklearn-compatible API for easy integration
- ✅ Prefer fully local processing
When to Use Julia SDK
Choose the Julia SDK if you:- ✅ Need maximum performance (native Julia)
- ✅ Want to build custom Bayesian models
- ✅ Work with RxInfer.jl ecosystem
- ✅ Need pre-trained model distribution
- ✅ Require enterprise support
Architecture
- Local Processing: All computation happens on your machine
- Privacy First: Your EEG data never leaves your computer
- sklearn Compatible: Works with existing ML workflows
- Fast Inference: JAX-compiled for performance
- Uncertainty Aware: Full Bayesian posterior distributions
Use Cases
Motor Imagery BCI
Control devices with imagined movements using CSP features and NimbusLDA
P300 Speller
Communication interfaces using ERP features and NimbusGMM
Real-time Neurofeedback
Streaming inference for live brain state monitoring
Research Pipelines
sklearn-compatible API for reproducible BCI research
What’s Included
Thenimbus-bci package provides:
Classifiers:
NimbusLDA- Bayesian Linear Discriminant AnalysisNimbusGMM- Bayesian Gaussian Mixture ModelNimbusSoftmax- Bayesian Multinomial Logistic Regression
BCIData- Container for features, metadata, labelsBCIMetadata- Metadata for BCI experiments
predict_batch()- Batch inference with diagnosticsStreamingSession- Real-time chunk processing
compute_entropy()- Prediction uncertaintycompute_calibration_metrics()- ECE/MCEcalculate_itr()- Information Transfer Rateassess_trial_quality()- Quality checks
estimate_normalization_params()- Feature normalizationdiagnose_preprocessing()- Preprocessing diagnosticscompute_fisher_score()- Feature discriminability
from_mne_epochs()- Convert MNE Epochs to BCIDataextract_csp_features()- CSP feature extractionextract_bandpower_features()- Bandpower features
Next Steps
Installation
Install nimbus-bci and verify your setup
Quickstart
Build your first BCI classifier in 5 minutes
API Reference
Complete API documentation with examples
MNE Integration
Use nimbus-bci with MNE-Python
Support
Need help? We’re here for you:- Email: [email protected]
- Documentation: Browse our comprehensive guides
- GitHub: github.com/nimbusbci/nimbuspysdk
- Examples: Check out working code samples in the package
Ready to get started? Head to the Installation Guide to install nimbus-bci.