MCPcopy
hub / github.com/mne-tools/mne-python / get_spectral_ratio

Method get_spectral_ratio

mne/decoding/ssd.py:324–353  ·  view source on GitHub ↗

Get the spectal signal-to-noise ratio for each spatial filter. Spectral ratio measure for best n_components selection See :footcite:`NikulinEtAl2011`, Eq. (24). Parameters ---------- ssd_sources : array Data projected to SSD space. Retur

(self, ssd_sources)

Source from the content-addressed store, hash-verified

322 return super().fit_transform(X, y=y, **fit_params)
323
324 def get_spectral_ratio(self, ssd_sources):
325 """Get the spectal signal-to-noise ratio for each spatial filter.
326
327 Spectral ratio measure for best n_components selection
328 See :footcite:`NikulinEtAl2011`, Eq. (24).
329
330 Parameters
331 ----------
332 ssd_sources : array
333 Data projected to SSD space.
334
335 Returns
336 -------
337 spec_ratio : array, shape (n_channels)
338 Array with the sprectal ratio value for each component.
339 sorter_spec : array, shape (n_channels)
340 Array of indices for sorting spec_ratio.
341
342 References
343 ----------
344 .. footbibliography::
345 """
346 spec_ratio, sorter_spec = _get_spectral_ratio(
347 ssd_sources=ssd_sources,
348 sfreq=self.sfreq_,
349 n_fft=self.n_fft_,
350 freqs_signal=self.freqs_signal_,
351 freqs_noise=self.freqs_noise_,
352 )
353 return spec_ratio, sorter_spec
354
355 def inverse_transform(self):
356 """Not implemented yet."""

Callers 2

test_get_spectral_ratioFunction · 0.95

Calls 1

_get_spectral_ratioFunction · 0.85

Tested by 1

test_get_spectral_ratioFunction · 0.76