plot_1d_smooth_clustered()#
- liesel_gam.plot_1d_smooth_clustered(clustered_term, samples, newdata=None, labels=None, color_scale='viridis', ngrid=20, newdata_meshgrid=False)[source]#
Plots a clustered smooth or linear function.
For effects as those returned by
TermBuilder.rs().- Parameters:
clustered_term (
Var) – The term to plot. Must be a weakliesel.model.Varwith named inputs"x"(the function) and"cluster"(the cluster).samples (
dict[str,Array|ndarray|bool|number|bool|int|float|complex]) – Dictionary of posterior samples. Must contain samples for the term’s coefficient.newdata (
None|dict[str,Array|ndarray|bool|number|bool|int|float|complex], default:None) – Dictionary of covariate data at which to plot the term. IfNone, plots the term for the unique clusters known to the term, and uses a grid of lengthngridbetween the minimum and maximum observed value in the clustered function’s covariate.labels (
CategoryMapping|None, default:None) – Custom mapping to use for mapping between string labels and integer codes.ngrid (
int, default:20) – Number of covariate values in the grid used for plotting, ifnewdata=None.newdata_meshgrid (
bool, default:False) – If True, then the function will create a large grid of all combinations of covariate values innewdatathat correspond to this term.