愉快的学习就从翻译开始吧_1-Time Series Forecasting with the Long Short-Term Memory Network in Python

王者一把用百里守约杀了6个0死10助攻就问还有谁,还有谁?马克在角落里说,22杀5死6助攻闭嘴

继续翻译

Experimental Test Setup/实验测试建立(什么鬼?这应该是训练,测试数据的划分,建立,为什么起了这么个奇怪的标题,就是告诉你,你特么以为写个程序容易?每一步都是试着来的,老子吐了几口老血,才试出来训练数据集要占总数据的2/3,余下的1/3为测试数据集偷笑

We will split the Shampoo Sales dataset into two parts: a training and a test set.

我们将分割洗发水销售数据集成两部分:训练和测试数据集

The first two years of data will be taken for the training dataset and the remaining one year of data will be used for the test set.

前两年的数据将被拿来作为训练数据集,余下一年的数据将被用作测试数据集

For example:

# split data into train and test
X = series.values
train, test = X[0:-12], X[-12:]

Models will be developed using the training dataset and will make predictions on the test dataset.

使用训练数据集开发模型(也就是训练),并将在测试数据集上进行预测(特么的就是验证)

A rolling forecast scenario will be used, also called walk-forward model validation.

使用滚动预测方案也被叫做前向模型验证(好吧,又出鬼了,不知道什么意思,看下面解释吧)

Each time step of the test dataset will be walked one at a time. A model will be used to make a forecast for the time step, then the actual expected value from the test set will be taken and made available to the model for the forecast on the next time step.

测试数据集的每个时间步将一次走一个。模型将被用来对本步做出预测,然后这个测试集中的实际的期望值将可被用于模型对下一步的预测(特么的就是当前这个数据是上一步的期望值,然后这个值用作输入进行下一步的预测,这特么的就是所谓的滚动!)

For example:

# walk-forward validation
history = [x for x in train]
predictions = list()
for i in range(len(test)):
	# make prediction...

This mimics a real-world scenario where new Shampoo Sales observations would be available each month and used in the forecasting of the following month.

这模拟了一个真实世界的情景,每个月都有新的洗发水销售数据(特么的就不能用data,非要用observations),并用于下个月的预测。

Finally, all forecasts on the test dataset will be collected and an error score calculated to summarize the skill of the model. The root mean squared error (RMSE) will be used as it punishes large errors and results in a score that is in the same units as the forecast data, namely monthly shampoo sales.

最后,测试数据集的所有预测值都被收集,并计算一个错误分数来评估模型的性能(特么就这么翻译,总结模型的技能?见鬼吧)均方根误差将被使用(作为优化器)因为它惩罚大的偏差,并切计算结果作为分数与预测数据有相同的单位,命名为月度洗发水销量(你他娘的应该叫月度洗发水销量偏差)

For example:

from sklearn.metrics import mean_squared_error
rmse = sqrt(mean_squared_error(test, predictions))
print('RMSE: %.3f' % rmse)

Examples

>>>
>>> from sklearn.metrics import mean_squared_error
>>> y_true = [3, -0.5, 2, 7]
>>> y_pred = [2.5, 0.0, 2, 8]
>>> mean_squared_error(y_true, y_pred)
0.375
>>> y_true = [[0.5, 1],[-1, 1],[7, -6]]
>>> y_pred = [[0, 2],[-1, 2],[8, -5]]
>>> mean_squared_error(y_true, y_pred)  
0.708...
>>> mean_squared_error(y_true, y_pred, multioutput='raw_values')
... 
array([ 0.416...,  1.        ])
>>> mean_squared_error(y_true, y_pred, multioutput=[0.3, 0.7])
... 
0.824...





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值