ValueError: Data cardinality is ambiguous: x sizes: 499001 y sizes: 2497
pycharm报错内容:
我的代码中是构建了一个GRU网络,在model.fit(x,y)部分出错,错误的原因应该是x和y的size不一致。
我做的预测是时间序列单步预测,且属于自回归模型。
举例说明为什么我的size设置不一致,原本应该是用本周周一到周五每天温度数据预测本周周六的温度,然后用本周周二到周六每天的温度数据预测本周周天的温度,以此类推。
假设我有一个月的数据:
那么x_train的shape=(30,5,1),y_train的shape=(30,1,1)这样是合理的。
但是由于一天24小时的温度是不同的,我现在想用本周周一到周五共5×24个小时的温度数据来预测本周周六的温度,那么此时我的x_train的shape=(30×24,5×24,1),y_train的shape不变,shape=(30,1,1),这就导致了y_train和x_train的size不同,程序报错。
结论:不确定上述设置训练集的方法是否存在可行性,但由常识来思考训练标签和训练数据应该处于同一度量单位下。
时间序列预测小白一枚,欢迎各位读者批评指正。
ValueError: Data cardinality is ambiguous: x sizes: 499001 y sizes: 2497相关推荐
- 关于Data cardinality is ambiguous:x sizes:y sizes: Make sure all arrays contain the same numbers
错误代码 def load_mat(path_data,name_data,reshapeSize,dtype='float32'):dataFile = path_datadata1 = scio. ...
- 成功解决ValueError: Data is not binary and pos_label is not specified
成功解决ValueError: Data is not binary and pos_label is not specified 目录 解决问题 解决思路 解决方法 解决问题 raise Value ...
- pyculiarity解决报错ValueError: data must be a 2 column data.frame, with thefirst column...
解决方法 报错全称为:ValueError: data must be a 2 column data.frame, with thefirst column being a set of times ...
- 成功解决ValueError: Invalid classes inferred from unique values of `y`. Expected: [0 1], got [‘0‘ ‘1‘]
成功解决ValueError: Invalid classes inferred from unique values of `y`. Expected: [0 1], got ['0' '1'] ...
- pytorch:data读取出错:RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension
在使用Dataloader读取数据的时候,使用batch_size=1不会出现这个问题.当batch_size>1时, 默认将会使用torch.stack()为你生成一个[batch,x, x, ...
- TypeError: strptime() takes no keyword arguments ValueError(“‘%s‘ is a bad directive in format ‘%s‘“
t=datetime.datetime.strptime("2021/5/12 09:28:11",format="%Y/%m/%d %h:%m:%s") 1. ...
- 3.深度学习练习:Planar data classification with one hidden layer
本文节选自吴恩达老师<深度学习专项课程>编程作业,在此表示感谢. 课程链接:https://www.deeplearning.ai/deep-learning-specialization ...
- 吴恩达深度学习(一)-第三周:Planar data classification with one hidden layer
Planar data classification with one hidden layer 本练习会建立只有一个隐藏层的神经网络,我们将看到这与逻辑回归有多大的差别. You will lear ...
- Mind the GAP: A Balanced Corpus of Gendered Ambiguous Pronouns--论文笔记
Mind the GAP: A Balanced Corpus of Gendered Ambiguous Pronouns 注意差距: 性别歧义代词的平衡语料库 Abstract Coreferen ...
最新文章
- Codeforces Round #Pi (Div. 2)(A,B,C,D)
- 零基础代码学python-零基础学python之构建web应用(入门级)
- 帮助理解GAN的一些补充内容
- Vue+Leaflet-side-by-side插件实现拉帘对比效果
- SCSS SASS Color 颜色函数用法
- vue路由跳转权限_如何在vue中实现路由跳转判断用户权限功能?
- php7 电子书 下载,PHP 7: Real World Application Development
- mysql的简单实用_MySQL的简单实用 手把手教学
- python安装plotly教程_python plotly 使用教程
- 联想笔记本linux驱动,联想为Linux驱动的计算机提供自动固件更新
- 文件上传利器SWFUpload入门简易教程(转)
- <一起JS(基础篇)>4.标识符、字符串、Number、波尔值、Null和Undefined
- cesium中文教程(cesium中文教程PDF)
- 了解talkingData
- 2017下半年网络工程师考试报名方式
- 在Mac上怎么使用Charles进行抓包
- 使用PY003基于外部中断+定时器的方式实现NEC红外解码
- word文件取消只读模式
- 基于android的单词记忆英语考试系统app
- php实现第三方登录