mne.preprocessing.
Xdawn
(n_components=2, signal_cov=None, correct_overlap='auto', reg=None)¶Implementation of the Xdawn Algorithm.
Xdawn is a spatial filtering method designed to improve the signal to signal + noise ratio (SSNR) of the ERP responses. Xdawn was originally designed for P300 evoked potential by enhancing the target response with respect to the nontarget response. This implementation is a generalization to any type of ERP.
Parameters:  n_components : int (default 2)
signal_cov : None  Covariance  ndarray, shape (n_channels, n_channels)
correct_overlap : ‘auto’ or bool (default ‘auto’)
reg : float  str  None (default None)


See also
CSP
Notes
New in version 0.10.
References
[1] Rivet, B., Souloumiac, A., Attina, V., & Gibert, G. (2009). xDAWN algorithm to enhance evoked potentials: application to braincomputer interface. Biomedical Engineering, IEEE Transactions on, 56(8), 20352043.
[2] Rivet, B., Cecotti, H., Souloumiac, A., Maby, E., & Mattout, J. (2011, August). Theoretical analysis of xDAWN algorithm: application to an efficient sensor selection in a P300 BCI. In Signal Processing Conference, 2011 19th European (pp. 13821386). IEEE.
Attributes
filters_ 
(dict of ndarray) If fit, the Xdawn components used to decompose the data for each event type, else empty. 
patterns_ 
(dict of ndarray) If fit, the Xdawn patterns used to restore the signals for each event type, else empty. 
evokeds_ 
(dict of evoked instance) If fit, the evoked response for each event type. 
event_id_ 
(dict of event id) The event id. 
correct_overlap_ : bool 
Whether overlap correction was applied. 
Methods
__hash__ () <==> hash(x) 

apply (inst[, event_id, include, exclude]) 
Remove selected components from the signal. 
fit (epochs[, y]) 
Fit Xdawn from epochs. 
fit_transform (X[, y]) 
Fit to data, then transform it 
get_params ([deep]) 
Get parameters for this estimator. 
inverse_transform () 
Not implemented, see Xdawn.apply() instead. 
set_params (\*\*params) 
Set the parameters of this estimator. 
transform (epochs) 
Apply Xdawn dim reduction. 
__hash__
() <==> hash(x)¶apply
(inst, event_id=None, include=None, exclude=None)¶Remove selected components from the signal.
Given the unmixing matrix, transform data, zero out components, and inverse transform the data. This procedure will reconstruct the signals from which the dynamics described by the excluded components is subtracted.
Parameters:  inst : instance of Raw  Epochs  Evoked
event_id : dict  list of str  None (default None)
include : array_like of int  None (default None)
exclude : array_like of int  None (default None)


Returns:  out : dict of instance

fit
(epochs, y=None)¶Fit Xdawn from epochs.
Parameters:  epochs : Epochs object
y : ndarray  None (default None)


Returns:  self : Xdawn instance

fit_transform
(X, y=None, **fit_params)¶Fit to data, then transform it
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters:  X : numpy array of shape [n_samples, n_features]
y : numpy array of shape [n_samples]


Returns:  X_new : numpy array of shape [n_samples, n_features_new]

get_params
(deep=True)¶Get parameters for this estimator.
Parameters:  deep : boolean, optional


Returns:  params : mapping of string to any

inverse_transform
()¶Not implemented, see Xdawn.apply() instead.
set_params
(**params)¶Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
<component>__<parameter>
so that it’s possible to update each
component of a nested object.
Returns
——
self
transform
(epochs)¶Apply Xdawn dim reduction.
Parameters:  epochs : Epochs  ndarray, shape (n_epochs, n_channels, n_times)


Returns:  X : ndarray, shape (n_epochs, n_components * n_event_types, n_times)
