python - 如何使用 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)
解决方案
推荐阅读
- html - Fix position of elements when hovering on other elements
- c# - 可以为多个消费者缓存 IAsyncEnumerable 吗?
- c# - 如何让玩家朝着相机的方向移动
- android - 将多个文件上传到 Android 中的 Firebase Firestore
- system - 在 SysTick 控制和状态寄存器中启用标志后,未调用 SYS_TICK 处理程序函数
- linux - 如何在 Linux 上模拟中断机制
- windows - OSError:无法在上下文中读取文件:\\?\C:\project\.gradle\6.6.1\executionHistory\executionHistory.lock
- powershell - Power shell脚本删除一些旧数据以释放空间达到一定限制
- python - 使用 Tkinter 时如何解决 Python3 中的循环导入错误?
- java - Arrays的时间复杂度是多少,sort(String [])