gpt4 book ai didi

r - 寓言包 ARIMA 算法是否能够并行工作?

转载 作者:行者123 更新时间:2023-12-05 09:07:22 27 4
gpt4 key购买 nike

我正在尝试使用 fable 包为 1000 家商店创建预测。 fable 包是否像 forecast 函数一样并行工作?

非常感谢

最佳答案

您可以使用来自 future 包的 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.

https://fabletools.tidyverts.org/reference/model.html

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 创建于 2020-11-23 (v0.3.0)

关于r - 寓言包 ARIMA 算法是否能够并行工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64962026/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com