def split_and_zscore(self, data, test_run):
# Enforse type and size of the data
data = np.asarray(data)
if data.ndim == 1:
data = np.expand_dims(data, 1)
# Identify training and test samples
train = np.asarray(self.runs != test_run)
test = np.asarray(self.runs == test_run)
train_data = data[train]
test_data = data[test]
# Compute the mean and standard deviation of the training set
m, s = np.nanmean(train_data), np.nanstd(train_data)
# Scale the training and test set
train_data = (train_data - m) / s
test_data = (test_data - m) / s
return train_data, test_data
decoding_analysis.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录