简体   繁体   English

寓言中的和解耗尽了 RAM

[英]Reconciliation in Fable runs out of RAM

I am trying to use forecast reconciliation in to improve forecasts at low, intermittent hierarchy levels.我正在尝试使用forecast reconciliation来改进低、间歇性层次结构级别的预测。 However, my computer runs out of memory for anything but trivial examples.然而,我的电脑内存不足,除了一些琐碎的例子。

I am basing my analysis on example code from the presentation "Tidy Time Series & Forecasting in R : 10. Forecast Reconciliation" (bit.ly/fable2020, presented at rstudio::conf 2020) :我的分析基于演示文稿“Tidy Time Series & Forecasting in R : 10. Forecast Reconciliation”(bit.ly/fable2020,在 rstudio::conf 2020 上展示)中的示例代码:

tourism %>%
  aggregate_key(Purpose * (State / Region), Trips = sum(Trips)) %>%
  model(ets = ETS(Tripsl)) %>%
  reconcile(ets_adjusted = min_trace(ets)) %>%
  forecast(h = 2)

This runs fine, even on my 8 GB RAM laptop.这运行良好,即使在我的 8 GB RAM 笔记本电脑上也是如此。

However, our data has many more hieriarchy levels and groupings than this example, and the code is never able to complete.然而,我们的数据比这个例子有更多的层次结构和分组,并且代码永远无法完成。 As a reproducible example I have added more three dummy levels to the "tsibble::tourism" dataset and include these in the aggregate_key .作为一个可重复的示例,我向“tsibble::tourism”数据集添加了更多三个虚拟级别,并将它们包含在aggregate_key This runs out of memory even on my 50 GB RAM server!即使在我的 50 GB RAM 服务器上,这也会耗尽内存!

tourism %>% mutate(Region1 = Region, Region2 = Region, Region3 = Region) %>% 
  aggregate_key(Purpose * (State / Region/ Region1 / Region2 / Region3), Trips = sum(Trips)) %>%
  model(ets = ETS(Trips)) %>%
  reconcile(ets_adjusted = min_trace(ets)) %>%
  forecast(h = 2)

Error: cannot allocate vector of size 929 Kb错误:无法分配大小为 929 Kb 的向量

Question Is there some way I can run this without reducing hierarchy levels and without running out of memory?问题有什么方法可以在不降低层次结构和内存不足的情况下运行它吗? Thanks!谢谢!

Thanks for your interest in fable.感谢您对寓言的兴趣。 In the current CRAN version of fabletools (0.1.2) reconciliation is experimental, and as part of we have prioritised interface design/experimentation over performance.在 fabletools (0.1.2) 的当前 CRAN 版本中,协调是实验性的,作为我们的一部分,我们将界面设计/实验置于性能之上。

As part of this experimentation, we are trying to find new ways to flexibly identify the aggregation structure and build an appropriate summation matrix.作为此实验的一部分,我们正在尝试寻找新方法来灵活识别聚合结构并构建适当的求和矩阵。 Seemingly the current approach is not ideal for deep nesting of series as your example points out.正如您的示例所指出的,目前的方法似乎并不适合系列的深度嵌套。

I've written an alternate algorithm which I think performs better in these circumstances, both in terms of time and space complexity.我编写了一个替代算法,我认为它在这些情况下在时间和空间复杂性方面表现更好。 This should allow you to compute hierarchical forecasts without using too much memory.这应该允许您在不使用太多内存的情况下计算分层预测。

Update: This change is now published in version 0.1.3 of fabletools.更新:此更改现已发布在 fabletools 的 0.1.3 版中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM