首页 > 解决方案 > 如何使用 GreyKite 预测饱和时间序列?

问题描述

我正在使用 GreyKite 来预测看起来像是饱和值的时间序列数据。我想知道我是否可以做一些具体的事情来改善预测,使其不是一条直线。此外,我能做些什么来让人们知道该函数是单调的吗?

from greykite.framework.templates.autogen.forecast_config import ForecastConfig
from greykite.framework.templates.autogen.forecast_config import MetadataParam
from greykite.framework.templates.forecaster import Forecaster
from greykite.framework.templates.model_templates import ModelTemplateEnum
from greykite.framework.utils.result_summary import summarize_grid_search_results

# specify dataset information
metadata = MetadataParam(
 time_col="ts",  # name of the time column ("date" in example above)
 value_col="s",  # name of the value column ("sessions" in example above)
 freq="D"  # "H" for hourly, "D" for daily, "W" for weekly, etc.
           # Any format accepted by `pandas.date_range`
)

forecaster = Forecaster()  # Creates forecasts and stores the result
result = forecaster.run_forecast_config(  # result is also stored as `forecaster.forecast_result`.
 df=analysis_df,
 config=ForecastConfig(
     model_template=ModelTemplateEnum.SILVERKITE.name,
     forecast_horizon=30,  # forecasts 365 steps ahead
     coverage=0.95,         # 95% prediction intervals
     metadata_param=metadata
 )
)

ts = result.timeseries
fig = ts.plot()
plotly.io.show(fig)

灰风筝预报

标签: pythonforecasting

解决方案


推荐阅读