ref:
pip install torchinfo
bugfix:https://stackoverflow.com/questions/69742930/runtimeerror-nll-loss-forward-reduce-cuda-kernel-2d-index-not-implemented-for
https://pypi.org/project/torchinfo/
ref:https://www.linkedin.com/pulse/time-series-classification-model-based-transformer-gokmen/
git:https://github.com/mselmangokmen/TimeSeriesProject/tree/main

处理时间序列的分类问题

bugfix:

inputs = inputs.to(device=device, dtype=torch.float )
labels = labels.to(device=device, dtype=torch.long) # labels must be long type 之前是torch.int

数据集的含义

一共188列,其中前187列是特征,最后一列是classes分类。
Classes: [‘N’: 0, ‘S’: 1, ‘V’: 2, ‘F’: 3, ‘Q’: 4]
feature:187,看代码的意思是把前187的单一变量看成了一个时间序列,然后188列做为分类的label
所以,时间序列也没那么可怕,就是把纵向的变量码平了就行了。

通过修改之后,

accuracy 已经和其中一个sota大差不差了。
后面的修改:

  1. 把offset size加进去 todo, 多变量预测 todo?
  2. accuracy, precision,recall
  3. 改成多步训练,这个是成立的

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部