mne.decoding.PSDEstimator#
- class mne.decoding.PSDEstimator(sfreq=6.283185307179586, fmin=0, fmax=inf, bandwidth=None, adaptive=False, low_bias=True, n_jobs=None, normalization='length')[source]#
Compute power spectral density (PSD) using a multi-taper method.
- Parameters:
- sfreq
float
The sampling frequency.
- fmin
float
The lower frequency of interest.
- fmax
float
The upper frequency of interest.
- bandwidth
float
The bandwidth of the multi taper windowing function in Hz.
- adaptivebool
Use adaptive weights to combine the tapered spectra into PSD (slow, use n_jobs >> 1 to speed up computation).
- low_biasbool
Only use tapers with more than 90% spectral concentration within bandwidth.
- n_jobs
int
Number of parallel jobs to use (only used if adaptive=True).
- normalization‘full’ | ‘length’
Normalization strategy. If “full”, the PSD will be normalized by the sampling rate as well as the length of the signal (as in Nitime). Default is
'length'
.
- sfreq
Methods
fit
(epochs_data[, y])Compute power spectral density (PSD) using a multi-taper method.
fit_transform
(X[, y])Fit to data, then transform it.
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
set_fit_request
(*[, epochs_data])Configure whether metadata should be requested to be passed to the
fit
method.set_output
(*[, transform])Set output container.
set_params
(**params)Set the parameters of this estimator.
set_transform_request
(*[, epochs_data])Configure whether metadata should be requested to be passed to the
transform
method.transform
(epochs_data)Compute power spectral density (PSD) using a multi-taper method.
See also
- fit(epochs_data, y=None)[source]#
Compute power spectral density (PSD) using a multi-taper method.
- Parameters:
- Returns:
- selfinstance of
PSDEstimator
The modified instance.
- selfinstance of
- fit_transform(X, y=None, **fit_params)[source]#
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:
- Xarray_like of shape (n_samples, n_features)
Input samples.
- yarray_like of shape (n_samples,) or (n_samples, n_outputs), default=None
Target values (None for unsupervised transformations).
- **fit_params
dict
Additional fit parameters.
- Returns:
- get_metadata_routing()[source]#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routing
MetadataRequest
A
MetadataRequest
encapsulating routing information.
- routing
- set_fit_request(*, epochs_data: bool | None | str = '$UNCHANGED$') PSDEstimator [source]#
Configure whether metadata should be requested to be passed to the
fit
method.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True
(seesklearn.set_config()
). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in v1.3.
- set_output(*, transform=None)[source]#
Set output container.
See Introducing the set_output API for an example on how to use the API.
- Parameters:
- transform{“default”, “pandas”, “polars”}, default=None
Configure output of
transform
andfit_transform
.“default”: Default output format of a transformer
“pandas”: DataFrame output
“polars”: Polars output
None: Transform configuration is unchanged
New in v1.4: “polars” option was added.
- Returns:
- self
estimator
instance Estimator instance.
- self
- set_params(**params)[source]#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.
- set_transform_request(*, epochs_data: bool | None | str = '$UNCHANGED$') PSDEstimator [source]#
Configure whether metadata should be requested to be passed to the
transform
method.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True
(seesklearn.set_config()
). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed totransform
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it totransform
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in v1.3.