mne.decoding.TimeFrequency#
- class mne.decoding.TimeFrequency(freqs, sfreq=1.0, method='morlet', n_cycles=7.0, time_bandwidth=None, use_fft=True, decim=1, output='complex', n_jobs=1, verbose=None)[source]#
Time frequency transformer.
Time-frequency transform of times series along the last axis.
- Parameters:
- freqsarray_like of
float
, shape (n_freqs,) The frequencies.
- sfreq
float
|int
, default 1.0 Sampling frequency of the data.
- method‘multitaper’ | ‘morlet’, default ‘morlet’
The time-frequency method. ‘morlet’ convolves a Morlet wavelet. ‘multitaper’ uses Morlet wavelets windowed with multiple DPSS multitapers.
- n_cycles
float
|array
offloat
, default 7.0 Number of cycles in the Morlet wavelet. Fixed number or one per frequency.
- time_bandwidth
float
, defaultNone
If None and method=multitaper, will be set to 4.0 (3 tapers). Time x (Full) Bandwidth product. Only applies if method == ‘multitaper’. The number of good tapers (low-bias) is chosen automatically based on this to equal floor(time_bandwidth - 1).
- use_fftbool, default
True
Use the FFT for convolutions or not.
- decim
int
|slice
, default 1 To reduce memory usage, decimation factor after time-frequency decomposition. If
int
, returns tfr[…, ::decim]. Ifslice
, returns tfr[…, decim].Note
Decimation may create aliasing artifacts, yet decimation is done after the convolutions.
- output
str
, default ‘complex’ ‘complex’ : single trial complex.
‘power’ : single trial power.
‘phase’ : single trial phase.
- n_jobs
int
|None
The number of jobs to run in parallel. If
-1
, it is set to the number of CPU cores. Requires thejoblib
package.None
(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1
(sequential execution) unless the call is performed under ajoblib.parallel_config
context manager that sets another value forn_jobs
. The number of epochs to process at the same time. The parallelization is implemented across channels.- verbosebool |
str
|int
|None
Control verbosity of the logging output. If
None
, use the default verbosity level. See the logging documentation andmne.verbose()
for details. Should only be passed as a keyword argument.
- freqsarray_like of
Methods
fit
(X[, y])Do nothing (for scikit-learn compatibility purposes).
fit_transform
(X[, y])Time-frequency transform of times series along the last axis.
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
set_output
(*[, transform])Set output container.
set_params
(**params)Set the parameters of this estimator.
transform
(X)Time-frequency transform of times series along the last axis.
- fit_transform(X, y=None)[source]#
Time-frequency transform of times series along the last axis.
- Parameters:
- Returns:
- Xt
array
, shape (n_samples, n_channels, n_freqs, n_times) The time-frequency transform of the data, where n_channels can be zero- or 1-dimensional.
- Xt
- 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_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.