Predictor#
- class liesel_ptm.Predictor(name)[source]#
Bases:
Var
Organizes the terms of a structured additive predictor.
- Parameters:
name (
str
) – Name of the predictor.
See also
StructuredAdditiveTerm
Term in a structured additive predictor.
LinearTerm
Linear term.
RandomIntercept
Random intercept term.
Examples
Terms must be added to the predictor using the
+=
syntax:import liesel_ptm as ptm import numpy as np x = np.linspace(size=10) predictor = ptm.Predictor(name="pred") predictor += ptm.LinearSmooth(x, name="term1")
Terms can be accessed using both bracket- and dot-syntax, using the names of the terms:
predictor["term1"] predictor.term1
Methods
Returns predicted values for this predictor.
Alternative constructor for initializing the predictor with an intercept.
Attributes
Collects the names of the hyperparameters in this predictor and returns them in a list.
(Deprecated) List of parameters to be sampled via the No-U-Turn Sampler (NUTS).
Collects the names of the parameters in this predictor and returns them in a list.
Dictionary of terms in this predictor.
Intercept variable (if any).