寓言包 ARIMA 算法是否能够并行工作?
Does fable package ARIMA algorithm able to work parallel?
我正在尝试使用寓言包为 1000 家商店创建预测。 fable
包是否像 forecast
函数那样并行工作?
非常感谢
您可以使用未来包中的 plan()
并行模型拟合。
It is possible to estimate models in parallel using the future package. By specifying a future::plan() before estimating the models, they will be computed according to that plan.
library(fable)
#> Loading required package: fabletools
library(dplyr)
library(future)
plan(multisession)
tsibbledata::aus_retail %>%
filter(
Industry == "Food retailing"
) %>%
model(
snaive = SNAIVE(Turnover),
ets = ETS(log(Turnover) ~ error("A") + trend("A") + season("A")),
)
#> # A mable: 8 x 4
#> # Key: State, Industry [8]
#> State Industry snaive ets
#> <chr> <chr> <model> <model>
#> 1 Australian Capital Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 2 New South Wales Food retailing <SNAIVE> <ETS(A,A,A)>
#> 3 Northern Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 4 Queensland Food retailing <SNAIVE> <ETS(A,A,A)>
#> 5 South Australia Food retailing <SNAIVE> <ETS(A,A,A)>
#> 6 Tasmania Food retailing <SNAIVE> <ETS(A,A,A)>
#> 7 Victoria Food retailing <SNAIVE> <ETS(A,A,A)>
#> 8 Western Australia Food retailing <SNAIVE> <ETS(A,A,A)>
由 reprex package (v0.3.0)
于 2020-11-23 创建
根据 fabletools 0.2.1 的新版本,预测过程(不仅仅是模型拟合)可以 运行 并行使用 future.apply: https://github.com/tidyverts/fabletools/blob/master/NEWS.md . There is a pull request out for parallelizing the forecast function that isn't completed yet though: https://github.com/tidyverts/fabletools/pull/274 。希望不久!这是一个很棒的包。
我正在尝试使用寓言包为 1000 家商店创建预测。 fable
包是否像 forecast
函数那样并行工作?
非常感谢
您可以使用未来包中的 plan()
并行模型拟合。
It is possible to estimate models in parallel using the future package. By specifying a future::plan() before estimating the models, they will be computed according to that plan.
library(fable)
#> Loading required package: fabletools
library(dplyr)
library(future)
plan(multisession)
tsibbledata::aus_retail %>%
filter(
Industry == "Food retailing"
) %>%
model(
snaive = SNAIVE(Turnover),
ets = ETS(log(Turnover) ~ error("A") + trend("A") + season("A")),
)
#> # A mable: 8 x 4
#> # Key: State, Industry [8]
#> State Industry snaive ets
#> <chr> <chr> <model> <model>
#> 1 Australian Capital Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 2 New South Wales Food retailing <SNAIVE> <ETS(A,A,A)>
#> 3 Northern Territory Food retailing <SNAIVE> <ETS(A,A,A)>
#> 4 Queensland Food retailing <SNAIVE> <ETS(A,A,A)>
#> 5 South Australia Food retailing <SNAIVE> <ETS(A,A,A)>
#> 6 Tasmania Food retailing <SNAIVE> <ETS(A,A,A)>
#> 7 Victoria Food retailing <SNAIVE> <ETS(A,A,A)>
#> 8 Western Australia Food retailing <SNAIVE> <ETS(A,A,A)>
由 reprex package (v0.3.0)
于 2020-11-23 创建根据 fabletools 0.2.1 的新版本,预测过程(不仅仅是模型拟合)可以 运行 并行使用 future.apply: https://github.com/tidyverts/fabletools/blob/master/NEWS.md . There is a pull request out for parallelizing the forecast function that isn't completed yet though: https://github.com/tidyverts/fabletools/pull/274 。希望不久!这是一个很棒的包。