Skip to main content

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.

Python SDK

The nimbus-bci Python library provides sklearn-compatible Bayesian classifiers for Brain-Computer Interface applications. It delivers local probabilistic inference with uncertainty quantification, streaming support, and rich diagnostics. The optional NimbusSoftmax model uses JAX and is available with pip install nimbus-bci[softmax].

Start Here

Install nimbus-bci

Install and verify your Python SDK environment.

Run Quickstart

Build your first Bayesian BCI classifier in minutes.

Pick a Model

Compare NimbusLDA, NimbusQDA, NimbusSoftmax, and NimbusSTS.

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.
pip install nimbus-bci
New in nimbus-bci 0.4.1: active-learning helpers for label-efficient calibration, including suggest_next_trial(), should_query(), and calibration_sufficient(). See Active Learning.

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.

Active Learning

Rank unlabeled trials, request labels only when useful, and stop calibration when the posterior stabilizes.

Fully Local

No API keys required. All processing happens on your machine for maximum privacy.

Quick Example

from nimbus_bci import NimbusLDA
import numpy as np

# Create and fit classifier
clf = NimbusLDA()
clf.fit(X_train, y_train)

# Predict with uncertainty
predictions = clf.predict(X_test)
probabilities = clf.predict_proba(X_test)

# Works with sklearn pipelines
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler

pipe = make_pipeline(StandardScaler(), NimbusLDA())
pipe.fit(X_train, y_train)

Available Classifiers

The Python SDK provides four Bayesian classifiers:
ClassifierDescriptionBest For
NimbusLDABayesian LDA with shared covarianceFast, well-separated classes (motor imagery)
NimbusQDABayesian QDA with class-specific covariancesComplex distributions (P300)
NimbusSoftmaxBayesian logistic regression (Polya-Gamma VI)Non-Gaussian decision boundaries
NimbusSTSBayesian Structural Time Series (Extended Kalman Filter)Non-stationary data, long sessions
All classifiers provide:
  • Full posterior distributions
  • Uncertainty quantification
  • Online learning via partial_fit()
  • sklearn-compatible API
Note: NimbusSTS also includes state management methods (propagate_state(), get_latent_state(), set_latent_state()) for temporal adaptation.

Python vs Julia SDK

Both SDKs implement the same Bayesian models but with different design philosophies:
FeaturePython SDKJulia SDK
Installationpip install nimbus-bciPkg.add("NimbusSDK") + API key
API Stylesklearn-compatible classesFunctional + types
Integrationsklearn pipelines, MNE-PythonRxInfer.jl ecosystem
PerformanceFast local Python implementation; optional JAX SoftmaxFastest (native Julia)
API KeyNot requiredRequired
Use CaseProduction ML pipelinesResearch, custom models
LicenseProprietary (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

EEG Data → MNE-Python → nimbus-bci → Your Application
           (Preprocessing)  (Classification)  (Control/Analysis)
Key Design Principles:
  • 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: Efficient local inference, with optional JAX support for NimbusSoftmax
  • 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 NimbusQDA

Real-time Neurofeedback

Streaming inference for live brain state monitoring

Research Pipelines

sklearn-compatible API for reproducible BCI research

What’s Included

The nimbus-bci package provides: Classifiers:
  • NimbusLDA - Bayesian Linear Discriminant Analysis
  • NimbusQDA - Bayesian Quadratic Discriminant Analysis
  • NimbusSoftmax - Bayesian Multinomial Logistic Regression
  • NimbusSTS - Bayesian Structural Time Series (Extended Kalman Filter)
Data Structures:
  • BCIData - Container for features, metadata, labels
  • BCIMetadata - Metadata for BCI experiments
Inference:
  • predict_batch() - Batch inference with diagnostics
  • StreamingSession - Real-time chunk processing
Active Learning:
  • suggest_next_trial() - Rank unlabeled feature pools by informativeness
  • should_query() - Decide whether an arriving trial is worth labeling
  • calibration_sufficient() - Stop calibration when the posterior stabilizes
Metrics:
  • compute_entropy() - Prediction uncertainty
  • compute_calibration_metrics() - ECE/MCE
  • calculate_itr() - Information Transfer Rate
  • assess_trial_quality() - Quality checks
Utilities:
  • estimate_normalization_params() - Feature normalization
  • diagnose_preprocessing() - Preprocessing diagnostics
  • compute_fisher_score() - Feature discriminability
MNE Integration:
  • from_mne_epochs() - Convert MNE Epochs to BCIData
  • extract_csp_features() - CSP feature extraction
  • extract_bandpower_features() - Bandpower features

Next Read

Installation

Install nimbus-bci and verify your setup

Quickstart

Build your first BCI classifier in 5 minutes

API Reference

Complete API documentation with examples

Active Learning

Reduce calibration time with label-efficient trial selection

MNE Integration

Use nimbus-bci with MNE-Python

Support

Need help? We’re here for you:
Ready to get started? Head to the Installation Guide to install nimbus-bci.