【发布时间】:2018-05-04 17:35:36
【问题描述】:
早安,
我目前正在尝试运行用于回归的递归神经网络,在数据集上使用包“rnn”,称为数值波士顿房屋;具体来说,这是结构:
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 1038 obs. of 3 variables:
$ date : Date, format: "2013-11-19" "2013-11-20" "2013-11-21" "2013-11-22" ...
$ Quantità : num 0.85 0.85 -0.653 -0.653 -0.653 ...
$ Giacenza_In: num 0.945 1.648 -0.694 -0.694 -0.694 ...
#Split into train and test
cutoff = round(0.8*nrow(BostonHousing))
train_x <- BostonHousing[1:cutoff,]
test_x <- BostonHousing[-(1:cutoff),]
str(train_x)
#I apply the model and remove the first column because it's made up of dates
require(rnn)
model <- trainr( Y = train_x[,2],
X = train_x[,3],
learningrate = 0.05,
hidden_dim = 4,
numepochs = 100)
pred <- predictr( model, test_x[,3])
每当我尝试运行代码时,它都会给我标题中报告的错误。
基本上,考虑到当前库存的产品数量(Giacenza_In),我想预测“Quantità”(意思是订购的数量)
最好的问候,亚历山德罗
【问题讨论】: