mne_denoise.asr.JugglerASR#
- class mne_denoise.asr.JugglerASR(sfreq: float | None = None, cutoff: float = 20.0, strategy: str = 'dbscan', window_length: float = 0.5, window_overlap: float = 0.66, max_dropout_fraction: float = 0.1, min_clean_fraction: float = 0.25, picks: str | list[str] | list[int] | None = 'eeg', calibration_window_length: float = 1.0, calibration_window_overlap: float = 0.66, ref_max_bad_channels: float = 0.075, ref_tolerances: tuple[float, float] = (-inf, 5.5), blocksize: int = 10, max_dims: float | int = 0.66, reject_by_annotation: bool = True, skip_by_annotation: tuple[str, ...] = ('bad', 'bad_acq_skip'), cov_estimator: str = 'geometric_median', regularization: float = 1e-08, filter_kind: str = 'asr', window_criterion: float | int | str | None = None, window_criterion_tolerances: tuple[float, float] = (-inf, 7.0), lookahead: float | None = None, stepsize: int | None = None, max_mem_mb: int | None = 512, copy: bool = True, store_reconstruction_matrices: bool = False, selection_filter_kind: str = 'asr', dbscan_top_k: int = 5, dbscan_eps: float | str = 'auto', dbscan_min_samples: int | float | str = 'auto', gev_grid_size: int = 2048, min_reference_fraction: float = 0.05, random_state: int | None = None, n_jobs: int | None = None, verbose: bool | str | int | None = None)[source]#
JugglerASR estimator with pointwise reference-sample selection.
The selection stage uses DBSCAN or GEV statistics; the reconstruction stage is the standard ASR burst-repair operation.
- Parameters:
- sfreqfloat or None, default=None
Sampling frequency in Hz; inferred from MNE metadata when available.
- cutofffloat, default=20.0
ASR threshold multiplier.
- strategy{“dbscan”, “gev”}, default=”dbscan”
Reference-sample selection strategy.
- window_lengthfloat, default=0.5
Reconstruction-window length in seconds.
- window_overlapfloat, default=0.66
Reconstruction-window overlap.
- max_dropout_fractionfloat, default=0.1
Maximum dropped-sample fraction per window.
- min_clean_fractionfloat, default=0.25
Minimum clean fraction for threshold estimation.
- picksstr, list of str, list of int, or None, default=”eeg”
MNE channels to process; NumPy input uses all rows.
- calibration_window_lengthfloat, default=1.0
Fallback calibration-window length.
- calibration_window_overlapfloat, default=0.66
Fallback calibration-window overlap.
- ref_max_bad_channelsfloat, default=0.075
Maximum bad-channel fraction in a calibration window.
- ref_tolerancestuple of float, default=(-np.inf, 5.5)
Robust z-score bounds for fallback selection.
- blocksizeint, default=10
Samples per covariance block.
- max_dimsfloat or int, default=0.66
Maximum fraction or number of reconstructed dimensions.
- reject_by_annotationbool, default=True
Exclude bad annotated samples during calibration.
- skip_by_annotationtuple of str, default=(“bad”, “bad_acq_skip”)
Annotation prefixes treated as bad.
- cov_estimator{“geometric_median”, “mean”, “median”}, default=”geometric_median”
Calibration-covariance aggregation rule.
- regularizationfloat, default=1e-8
Relative covariance eigenvalue floor.
- filter_kind{“none”, “asr”, “highpass”}, default=”asr”
Statistics/pre-emphasis filter used by ASR calculations; it does not filter the returned data directly.
- window_criterionfloat, int, str, or None, default=None
Optional final retained-sample criterion.
- window_criterion_tolerancestuple of float, default=(-np.inf, 7.0)
Robust z-score bounds for the final criterion.
- lookaheadfloat or None, default=None
Processing lookahead in seconds.
- stepsizeint or None, default=None
Samples between reconstruction updates.
- max_mem_mbint or None, default=512
Memory bound for covariance processing.
- copybool, default=True
Reserved compatibility parameter; transformations return new outputs.
- store_reconstruction_matricesbool, default=False
Store per-window reconstruction matrices in diagnostics.
- selection_filter_kind{“none”, “asr”, “highpass”}, default=”asr”
Statistics/pre-emphasis filter used for reference-sample selection. It must match filter_kind.
- dbscan_top_kint, default=5
Number of largest channel amplitudes used as DBSCAN features.
- dbscan_epsfloat or str, default=”auto”
DBSCAN neighborhood radius.
- dbscan_min_samplesint, float, or str, default=”auto”
DBSCAN core-neighborhood count.
- gev_grid_sizeint, default=2048
Number of GEV mode-estimation grid points.
- min_reference_fractionfloat, default=0.05
Minimum retained reference-sample fraction.
- random_stateint or None, default=None
Reserved for reproducibility.
- n_jobsint or None, default=None
Reserved for future parallel processing.
- verbosebool, str, int, or None, default=None
Logging level.
See also
ASRStandard ASR calibration and reconstruction.
AdaptiveASRAdaptive calibration-state updates rather than pointwise sample selection.
Notes
The fitted calibration mask is sample-based rather than window-based [1].
References
- fit(X: BaseRaw | BaseEpochs | np.ndarray, y=None, calibration: BaseRaw | BaseEpochs | np.ndarray | None = None, calibration_mask: np.ndarray | None = None, *, callback=None, verbose: bool | str | int | None = None) JugglerASR[source]#
Fit JugglerASR and select reference samples.
- Parameters:
- XRaw, Epochs, or ndarray
Primary data stream.
- yNone, default=None
Ignored for scikit-learn compatibility.
- calibrationRaw, Epochs, or ndarray, default=None
Optional separate calibration data.
- calibration_maskndarray of bool or None, default=None
Optional pre-selection mask for calibration samples.
- callbackcallable or None, default=None
Synchronous calibration progress callback.
- verbosebool, str, int, or None, default=None
Logging level for this call.
- Returns:
- JugglerASR
The fitted estimator.