If I understand the code correctly, the plot_cap (Conditional Adjusted Predictions) function does posterior prediction on out of sample data with the goal of visualising how the outcome variable varies as a function of (some) interpolated predictor variables.

the goal of visualising how the outcome variable varies as a function of (some) interpolated predictor variables.

Instead of “outcome variable” I would say “model parameter”. The visualization shows, by default, how the mean varies as a function of a predictor. You can choose to show another parameter instead of the mean when you have a distributional model.

For the “marginal” vs “conditional” I really like this resource Get Started • marginaleffects. It’s from the R library where I took the idea of plot_cap.

As far as I understand conditional adjusted predictions are different from marginal effects because they’re conditional on specific values for all the predictors. To get the marginal effect you would need “marginalize” over the conditional adjusted predictions. Perhaps this could be added to Bambi in the future.

You won’t find plot_cap in the marginaleffects package because it was renamed a few months ago and it’s called plot_predictions now (perhaps it’s a better name? what do you think?)