Plotting functions¶
Plotting functions provide visualizations for one-dimensional GP models, truth-vs-prediction diagnostics, LOO errors, matrix plots, and parallel coordinates.
All Matplotlib functions create or update figures and call show. They are
intended for interactive examples and diagnostics. Convert backend tensors to
NumPy arrays before passing them to functions that use Matplotlib directly.
- gpmpcontrib.plot.visualization.plot_1d(xt, zt, xi, zi, zpm, zpv, zpsim=None, xnew=None, title=None)[source]¶
Visualize the results of the predictions and the dataset.
Parameters: xt (ndarray): Test points zt (ndarray): True values at test points xi (ndarray): Input data points zi (ndarray): Output values at input data points zpm (ndarray): Posterior mean values zpv (ndarray): Posterior variances zpsim (ndarray, optional): Conditional sample paths xnew (ndarray, optional): New data point being added title (str, optional): Title for the plot
- gpmpcontrib.plot.visualization.plotmatrix(data, colors=None)[source]¶
Generates a matrix scatter plot from the given 2D numerical numpy array or matrix, optionally colorizing the scatter points based on an n x 1 ndarray.
Parameters: data (2D numpy array): A matrix of numerical data. colors (1D numpy array, optional): An array of values to color the scatter points.
- gpmpcontrib.plot.visualization.show_loo_errors(zi, zloom, zloov)[source]¶
Visualize leave-one-out errors for each output dimension.
- gpmpcontrib.plot.visualization.show_truth_vs_prediction(zt, zpm)[source]¶
Visualize the predictions vs truth
- gpmpcontrib.plot.visualization.plot_1d(xt, zt, xi, zi, zpm, zpv, zpsim=None, xnew=None, title=None)[source]
Plot a one-dimensional GP prediction.
xtandxiare input locations.ztis an optional reference curve.zpmandzpvare posterior mean and variance arrays onxt.zpsimcan contain conditional sample paths with one path per column.
- gpmpcontrib.plot.visualization.show_truth_vs_prediction(zt, zpm)[source]
Draw one scatter plot per output comparing reference values
ztand posterior meanszpm. Both arrays have shape(m, output_dim).
- gpmpcontrib.plot.visualization.show_loo_errors(zi, zloom, zloov)[source]
Draw one LOO plot per output.
zi,zloom, andzloovhave shape(n, output_dim).
- gpmpcontrib.plot.visualization.plotmatrix(data, colors=None)[source]
Draw pairwise scatter plots and marginal histograms for
datawith shape(n, d).colorscan provide one scalar color value per row.
- gpmpcontrib.plot.visualization.parallel_coordinates_plot(x, z, p=None, show_p=False, xi=None, zi=None, ci=None, show_type=False)[source]
Draw a Plotly parallel-coordinates plot for multivariate data.
xhas shape(n, d)andzhas shape(n, q). Optionalxiandziadd a second data set with matching dimensions. Returns a Plotlygo.Figure.