bebi103.viz.predictive_regression
- bebi103.viz.predictive_regression(samples, samples_x, data=None, diff=False, percentiles=[95, 68], color='blue', data_kwargs=None, p=None, **kwargs)
Plot a predictive regression plot from samples.
- Parameters
samples (Numpy array, shape (n_samples, n_x) or xarray DataArray) – Numpy array containing predictive samples of y-values.
sample_x (Numpy array, shape (n_x,)) –
data (Numpy array, shape (n, 2) or xarray DataArray) – If not None, the measured data. The first column is the x-data, and the second the y-data. These are plotted as points over the predictive plot.
diff (bool, default True) – If True, the predictive y-values minus the median of the predictive y-values are plotted.
percentiles (list, default [95, 68]) – Percentiles for making colored envelopes for confidence intervals for the predictive ECDFs. Maximally four can be specified.
color (str, default 'blue') – One of [‘green’, ‘blue’, ‘red’, ‘gray’, ‘purple’, ‘orange’]. There are used to make the color scheme of shading of percentiles.
data_kwargs (dict, default None) – Any kwargs to be passed to p.circle() when plotting the data points.
p (bokeh.plotting.Figure instance, or None (default)) – If None, create a new figure. Otherwise, populate the existing figure p.
kwargs – All other kwargs are passed to bokeh.plotting.figure().
- Returns
output – Figure populated with glyphs describing range of values for the the samples. The shading goes according to percentiles of samples, with the median plotted as line in the middle.
- Return type
Bokeh figure