DEAP dataset数据集 SEED dataset数据集

数据集:一个是公开数据集,一个自己做实验

自己做实验,一方面设备昂贵不够准确,另一方面公信力不够,更多用公开数据

但deap数据集申请时间长难度大,就网站有偿找了一份,用代码跑了一遍。

DEAP 数据集

数据集与相关的代码 链接

资料

data_preprocessed_python

提取处理函数

def save_all_labels_into_file():
    x = pickle.load(open('D:\eng\data_preprocessed_python\s01.dat', 'rb'), encoding='latin1')  # dict
    labels = x['labels']
    valence_and_arousal = (labels[:, [0, 1]] - 5) / 4
    labelswithanglesandemotions = append_angle_and_emotion(valence_and_arousal)
    for i in range(2, 33):
        x = pickle.load(
            open('D:\eng\data_preprocessed_python\s' + str(i).zfill(2) + '.dat', 'rb'), encoding='latin1')  # dict
        labels = x['labels']  # numpy.ndarray
        # valence,arousal,dominance,liking
        valence_and_arousal = (labels[:, [0, 1]] - 5) / 4
        labelswithanglesandemotions = numpy.concatenate(
            (labelswithanglesandemotions, append_angle_and_emotion(valence_and_arousal)), 0)
    with open('D:\eng\data_preprocessed_python\labels.txt', 'wb') as outfile:
        numpy.savetxt(outfile, labelswithanglesandemotions, "%.2f")

SEED数据集

资料

数据提取代码

from utils.tools import build_preprocessed_eeg_dataset_CNN, RawEEGDataset, subject_independent_data_split
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter


# 加载数据,整理成所需要的格式
folder_path = '../data/Preprocessed_EEG/'
feature_vector_dict, label_dict = build_preprocessed_eeg_dataset_CNN(folder_path)
train_feature, train_label, test_feature, test_label = subject_independent_data_split(feature_vector_dict, label_dict,
                                                                                      {'2', '6', '9'})

desire_shape = [1, 62, 200]
train_data = RawEEGDataset(train_feature, train_label, desire_shape)
test_data = RawEEGDataset(test_feature, test_label, desire_shape)

  • 10
    点赞
  • 58
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大大U

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值