stanbkt.utils.posterior_summary#
- stanbkt.utils.posterior_summary(draws, col_mapping=None, quantiles=[0.025, 0.975], data=None)#
Summarise posterior predictions into per-observation statistics.
- Parameters:
draws (
Union[dict[str,DataFrame],dict[str,CmdStanGQ]]) – Either draw-level DataFrames (as returned bypredict_posterior_drawsorpredict_smoothed_posterior_draws), or raw CmdStanGQ objects (as returned bypredict_posterior_stanorpredict_smoothed_posterior_stan). When passing CmdStanGQ objects,datamust also be supplied.col_mapping (
Union[Mapping[ColumnNames,str],Mapping[str,str],Mapping[ColumnNames|str,str],None]) – Column name mapping. IfNone, the standardColumnNamesdefaults are used.quantiles (
list[float]) – Credible-interval quantiles to include in the summary. Each value must be in[0, 1].data (
Optional[DataFrame]) – Original student interaction data. Required whendrawscontains CmdStanGQ objects; ignored otherwise.
- Returns:
Long-form summary with mean, std, median, and the requested quantiles for pKnow and pCorrectness.
- Return type: