愉快的学习就从翻译开始吧_How to Convert a Time Series to a Supervised Learning Problem in Python_3

One-Step Univariate Forecasting/单步单变量预测

It is standard practice in time series forecasting to use lagged observations (e.g. t-1) as input variables to forecast the current time step (t).
时间序列预测的标准做法是使用滞后观测值(例如t-1)作为输入变量来预测当前时间步长(t)。

This is called one-step forecasting.

这被称为一步预测。

The example below demonstrates a one lag time step (t-1) to predict the current time step (t).

下面的例子演示了预测当前时间步长(t)的一个滞后时间步长(t-1)。

Running the example prints the output of the reframed time series.

运行例子,打印重构的时间序列

We can see that the observations are named “var1” and that the input observation is suitably named (t-1) and the output time step is named (t).

我们可以看到,观察结果被命名为“var1”,并且输入观察值被命名为(t-1),输出时间步骤命名为(t)。

We can also see that rows with NaN values have been automatically removed from the DataFrame.

我们还可以看到具有NaN值的行已自动从DataFrame中删除。

We can repeat this example with an arbitrary number length input sequence, such as 3. This can be done by specifying the length of the input sequence as an argument; for example:

我们可以用任意数字长度的输入序列重复这个例子,例如3.这可以通过将输入序列的长度指定为参数来完成。 例如:

The complete example is listed below.

下面列出了完整的示例。

Again, running the example prints the reframed series. We can see that the input sequence is in the correct left-to-right order with the output variable to be predicted on the far right.

再次,运行该示例打印重构系列。 我们可以看到,输入序列按照正确的从左到右的顺序排列,将被预测的输出变量在最右边。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值