Cookbook
The Whittaker Cookbook is filled with short and self-contained recipes that try to answer one question at a time. Every recipe is fully executable so you can copy the code and run it easily in your own environment.
Getting started
Start here if you are new to Whittaker. These recipes cover the core workflow: fitting a model, picking the right response distribution, and reading the output.
Smooth terms
The smooth term (its basis type, basis dimension, and interaction structure) is the main modeling decision in a GAM. These recipes cover the most useful smooth types and how to configure them.
Response families
The response family determines the assumed distribution of your outcome and the link function that connects it to the linear predictor. These recipes show how to handle counts, binary outcomes, and proportions (the most common departures from a Gaussian response).
Prediction and inference
A fitted GAM is most useful when you can generate predictions at new inputs and attach uncertainty estimates. These recipes cover point predictions, standard errors, and several flavors of confidence interval.
Diagnostics and model selection
Before trusting a model’s predictions you should verify that it is well-specified. These recipes walk through basis dimension checks, residual analysis, and how to choose a smoothness selection criterion.
Shape constraints
Shape-constrained smooths enforce monotone or convex behavior when domain knowledge demands it. Use them to make a GAM obey known physical constraints while still fitting the data nonparametrically.
Data input
Whittaker accepts Pandas DataFrames, Polars DataFrames, PyArrow Tables, plain dicts, and NumPy arrays interchangeably. This section shows how to work with data formats you may already have on hand, including how to account for exposure with an offset term.
Advanced models
These recipes cover specialized GAM extensions for structured problems: heteroscedastic responses, zero-inflated counts, quantile and conformal inference, causal estimation, multiple correlated responses, functional predictors, and online learning.
Large datasets
When data is too large to hold in memory, these approaches fit the same smooth models without materializing the full design matrix (using discretization, DuckDB, or Polars streaming).
Deployment
Once a model is fit, you will often need to persist it, share it, or work with it in an existing ML pipeline. These recipes cover serialization, scikit-learn compatibility, and R interoperability.