class_docstr: Encapsulate PyStan specific logic.
class_docstr_tok: ["Encapsulate","PyStan","specific","logic","."]
docstr: Convert predictions samples to xarray.
code: def predictions_to_xarray(self):
      """Convert predictions samples to xarray."""
      posterior = self.posterior
      predictions = self.predictions
      data, data_warmup = get_draws(
          posterior,
          variables=predictions,
          warmup=self.save_warmup,
          dtypes=self.dtypes,
      )
      return (
          dict_to_dataset(
              data,
              library=self.pystan,
              coords=self.coords,
              dims=self.dims,
          ),
          dict_to_dataset(
              data_warmup,
              library=self.pystan,
              coords=self.coords,
              dims=self.dims,
          ),
      )
  
imports: import re
  from collections import OrderedDict
  from copy import deepcopy
  from math import ceil
  import numpy
  import xarray
  from ..None import _log
  from ..rcparams import rcParams
  from .base import dict_to_dataset, generate_dims_coords, infer_stan_dtypes, make_attrs, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 6 for calling the PyStanConverter obj's underlying member method code with example usage: obj.predictions_to_xarray() and returns: dict_to_dataset,  dict_to_dataset