gluonts.nursery.few_shot_prediction.src.meta.vis.forecast module#

gluonts.nursery.few_shot_prediction.src.meta.vis.forecast.plot_forecast_supportset_attention(query_past: List[numpy.ndarray], query_future: List[numpy.ndarray], pred: List[numpy.ndarray], supps: List[numpy.ndarray], attention: List[numpy.ndarray], quantiles: List[str]) matplotlib.figure.Figure[source]#

Plots the provided forecasts for each sample with confidence intervals using all provided quantiles. Furthermore, plots the time series in the support set of this sample aligned with their attention scores.

Parameters
  • query_past (List[np.ndarray] of length n_samples, each array has shape [context length]) – The past query which the model uses to make a prediction.

  • query_future (List[np.ndarray] of length n_samples, each array has shape [prediction horizon length]) – The ground truth for the forecast.

  • pred (List[np.ndarray], of length n_samples, each array has shape [prediction horizon length, n_quantiles]) – The prediction of the model.

  • supps (List[np.ndarray], length is n_samples, each item has shape[supps_size, support ts length]) – The support sets for each query.

  • attention (List[np.ndarray], length is n_samples, each item has shape[supps_size, support ts length]) – The attention scores for each support set times series.

  • quantiles (List[float], shape[n_quantiles,]) –

Returns

A plot containing one subplot for each sample. Each subplot displays the ground truth, predicted confidence intervals, the predicted median. Furthermore, the time series in the support set aligned with their attention scores.

Return type

plt.figure.Figure

gluonts.nursery.few_shot_prediction.src.meta.vis.forecast.plot_point_forecast(sub, query_past, query_future, pred)[source]#
gluonts.nursery.few_shot_prediction.src.meta.vis.forecast.plot_quantile_forecast(query_past: List[numpy.ndarray], query_future: List[numpy.ndarray], pred: List[numpy.ndarray], quantiles: List[str]) matplotlib.figure.Figure[source]#

Plots the provided forecasts for each sample with confidence intervals using all provided quantiles.

Parameters
  • query_past (List[np.ndarray] of length n_samples, each array has shape [context length]) – The past query which the model uses to make a prediction.

  • query_future (List[np.ndarray] of length n_samples, each array has shape [prediction horizon length]) – The ground truth for the forecast.

  • pred (List[np.ndarray], of length n_samples, each array has shape [prediction horizon length, n_quantiles]) – The prediction of the model.

  • quantiles (List[float], shape[n_quantiles,]) –

Returns

A plot containing one subplot for each sample. Each subplot displays the ground truth, predicted confidence intervals and the predicted median.

Return type

plt.figure.Figure