API 参考
绘图
时间序列可视化
源代码
plot_series
绘制预测和样本内值。
类型 | 默认值 | 详情 | |
---|---|---|---|
df | 可选的 | None | 带有 [id_col , time_col , target_col ] 列的 DataFrame。 |
forecasts_df | 可选的 | None | 带有 [id_col , time_col ] 列和模型的 DataFrame。 |
ids | 可选的 | None | 要绘制的时间序列。 如果为 None,则随机选择时间序列。 |
plot_random | bool | True | 随机选择要绘制的时间序列。 |
max_ids | int | 8 | 要绘制的最大 id 数。 |
models | 可选的 | None | 要绘制的模型。 |
level | 可选的 | None | 要绘制的预测区间。 |
max_insample_length | 可选的 | None | 要绘制的最大训练/样本内观测数。 |
plot_anomalies | bool | False | 绘制每个预测区间的异常值。 |
engine | str | matplotlib | 用于绘图的库。‘plotly’、‘plotly-resampler’ 或 ‘matplotlib’。 |
palette | 可选的 | None | 用于绘图的 matplotlib 颜色图名称。如果为 None,则使用当前样式。 |
id_col | str | unique_id | 标识每个系列(时间序列)的列。 |
time_col | str | ds | 标识每个时间步长的列,其值可以是时间戳或整数。 |
target_col | str | y | 包含目标值的列。 |
seed | int | 0 | 随机数生成器使用的种子。仅在 plot_random 为 True 时使用。 |
resampler_kwargs | 可选的 | None | 传递给 plotly-resampler 构造函数的关键字参数。 如需进一步定制(“show_dash”),请调用该方法, 存储绘图对象并向其添加额外参数到 其 show_dash 方法。 |
ax | Union | None | 将添加绘图的对象。 |
返回 | matplotlib 或 plotly 图形 | 绘图图形 |