auto_sarima fourier分量

前言

auto_sarima使用非常简单, 只需输入周期M即可; 比如上一篇提到的kaggle商品预测比赛, 每年的圣诞节(12月)会有一波大的销量上涨;此时可以设置周期m=12(即12个月一个周期);

model = auto_arima(train, seasonal=True, m=12)

auto_sarima fourier分量_第1张图片

问题:

在我的场景,需要使用m=168为周期;
由于m最后是作为幂次方进行运算的, 所以计算会非常慢, 而且效果也不好;

解决

使用fourier分量;

pipe = pipeline.Pipeline([
    ("fourier", ppc.FourierFeaturizer(m=168, k=18)),
    ("arima", arima.AutoARIMA(stepwise=True, trace=1, error_action="ignore",
                              seasonal=False,  # because we use Fourier
                              suppress_warnings=True))
])

参考链接如下:
• Helpful for long seasonal periods (large m) where seasonal=True seems to take a very long time to fit a model.

来自 https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.preprocessing.FourierFeaturizer.html#pmdarima.preprocessing.FourierFeaturizer

  • Pipelines with auto_arima

来自 https://alkaline-ml.com/pmdarima/auto_examples/example_pipeline.html#sphx-glr-auto-examples-example-pipeline-py

你可能感兴趣的:(机器学习/,数据挖掘,人工智能)