sklearn Integration
The nimbus-bci classifiers are fully compatible with scikit-learn, allowing seamless integration with pipelines, cross-validation, hyperparameter tuning, and the broader sklearn ecosystem.sklearn-Compatible API
All nimbus-bci classifiers implement the sklearn estimator interface:Pipelines
Basic Pipeline
Combine preprocessing with classification:Multi-Step Pipeline
Add feature selection and normalization:BCI-Specific Pipeline
Complete BCI preprocessing pipeline:Cross-Validation
Basic Cross-Validation
Evaluate model performance:Stratified K-Fold
Maintain class balance in folds:Multiple Metrics
Evaluate multiple metrics simultaneously:Leave-One-Subject-Out
For BCI with multiple subjects:Hyperparameter Tuning
Grid Search
Exhaustive search over parameter grid:Random Search
More efficient for large parameter spaces:Pipeline Parameter Tuning
Tune parameters across entire pipeline:Model Selection
Compare Multiple Classifiers
Compare different nimbus-bci classifiers:Compare with sklearn Classifiers
Benchmark against sklearn models:Feature Selection
Univariate Feature Selection
Select best features before classification:Recursive Feature Elimination
Iteratively remove least important features:Ensemble Methods
Voting Classifier
Combine multiple nimbus-bci classifiers:Bagging
Bootstrap aggregating for variance reduction:Calibration
Probability Calibration
Calibrate predicted probabilities:Custom Transformers
BCI-Specific Transformer
Create custom transformer for BCI preprocessing:Performance Evaluation
Comprehensive Metrics
Evaluate with multiple metrics:ROC and AUC
For binary classification:Saving and Loading
Joblib Persistence
Save entire pipeline:Best Practices
1. Always Use Pipelines
Encapsulate preprocessing with classification:2. Use Stratified Splits
Maintain class balance:3. Tune Hyperparameters
Always optimize hyperparameters:4. Evaluate on Held-Out Test Set
Never tune on test data:Next Read
Streaming Inference
Real-time BCI with chunk processing
MNE Integration
Complete EEG preprocessing pipeline
API Reference
Complete API documentation
Examples
Working code examples