def transform(self, epochs_data, y=None):
"""Standardizes data across channels
Parameters
----------
epochs_data : array, shape (n_epochs, n_channels, n_times)
The data.
y : None | array, shape (n_epochs,)
The label for each epoch.
If None not used. Defaults to None.
Returns
-------
X : array, shape (n_epochs, n_channels, n_times)
The data concatenated over channels.
"""
if not isinstance(epochs_data, np.ndarray):
raise ValueError("epochs_data should be of type ndarray (got %s)."
% type(epochs_data))
X = np.atleast_3d(epochs_data)
for key, this_pick in six.iteritems(self.picks_list_):
if self.with_mean:
X[:, this_pick, :] -= self.ch_mean_[key]
if self.with_std:
X[:, this_pick, :] /= self.std_[key]
return X
transformer.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录