Skip to main content

Crate prospicio_models

Crate prospicio_models 

Source
Expand description

The model interface and its life cycle, shared by every engine (GLM, GAM, neural networks, boosting adapters, Bayesian models). See docs/design/models.md.

  • Family and Link: exponential dispersion families and link functions, the likelihoods and losses engines share;
  • Terms, Coding and Design: model terms, factor coding learned on training data, and the design matrix with offset and weights;
  • Model and Fitted: fit, predict, and joint predictive distributions;
  • metrics: deviance, Gini, lift, CRPS, coverage;
  • resample: k-fold, grouped and time-ordered splits, cross-validation and grid search;
  • simulate: predictive distributions from fitted means, for engines that give only a mean per row (the boosting adapters).

This crate has no heavy dependencies; engines live in their own crates.

Re-exports§

pub use design::Coding;
pub use design::Column;
pub use design::Design;
pub use design::Frame;
pub use design::Term;
pub use design::Terms;
pub use family::Family;
pub use model::Fitted;
pub use model::Model;

Modules§

compare
One table of out-of-sample scores across models of any kind.
design
Design matrices: turning named columns into the numeric matrix a model fits, the same way on training data and on new data.
family
Exponential dispersion families: what a GLM, a neural network’s loss, a booster’s objective and a Bayesian likelihood all share.
link
Link functions: η = g(μ) between the mean and the linear predictor.
metrics
Scores for fitted models: deviance-based, ranking (Gini, lift), calibration (actual vs expected), and probabilistic (CRPS, coverage, log score, PIT).
model
The interface every model implements, whatever its engine.
monitor
Monitoring a stored model on new periods: actual against expected.
resample
Resampling: train/test splits, cross-validation, and grid and random search.
simulate
Predictive distributions from fitted means, for engines that give a mean per row and nothing else (gradient boosting through its Python or R package, an imported network): the family adds the process noise, and several mean vectors (bootstrap refits) add the parameter uncertainty.
stack
Model weights for blending from pointwise out-of-sample log predictive densities: stacking and pseudo-BMA (Yao, Vehtari, Simpson and Gelman, 2018, “Using stacking to average Bayesian predictive distributions”).