tsicl.plot.imputation.plot_sample_imputation#

tsicl.plot.imputation.plot_sample_imputation(quantiles: numpy.ndarray | torch.Tensor, y_ctx: numpy.ndarray | torch.Tensor, y_true: numpy.ndarray | torch.Tensor | None = None, quantiles_univar: numpy.ndarray | torch.Tensor | None = None, quantile_levels: list | None = None, show_context_points: bool = False, plot_iqr: bool = False, z_normalize: bool = False, model_name: str = 'TS-ICL', iqr_bands: Sequence = ((0.05, 0.95), (0.25, 0.75)), max_points: int = -1, is_blockwise: bool = False) Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]#

Imputation plot util for a single sample.

Parameters:
  • quantiles (np.ndarray | torch.Tensor) – array of predicted quantiles, shape (t, q)

  • y_ctx (np.ndarray | torch.Tensor) – available context as a 1D-array of len t with `NaN`s

  • y_true (np.ndarray | torch.Tensor | None) – 1D-array of ground truth, len t

  • quantiles_univar (np.ndarray | torch.Tensor | None) – if quantiles is predicted with covariates quantiles_univar is the estimated same target variable but without covariates. array of predicted quantiles, shape (t, q)

  • quantile_levels (list | None) – list of the q quantile levels used in quantiles

  • show_context_points (bool) – whether to show available observations as markers

  • plot_iqr (bool) – whether to plot InterQuantile Ranges, if available

  • z_normalize (bool) – whether to z-normalize all data before plotting

  • model_name (str) – model name to use in legend

  • iqr_bands (Sequence) – iterable sequence of IQRs bands (low, high) to plot

  • max_points (int) – how many time points to plot (will plot all if <0)

  • is_blockwise (bool) – if True, assumes that missing points are contiguous and will shade the corresponding regions

Returns:

The corresponding matplotlib figure and axes.