revrand.basis_functions.LinearBasis

class revrand.basis_functions.LinearBasis(onescol=True, regularizer=None)

Linear basis class, basically this just prepends a columns of ones onto X.

\[\phi(\mathbf{X}) = [\mathbf{1}, \mathbf{X}]\]
Parameters:
  • onescol (bool, optional) – If true, prepend a column of ones onto X.
  • regularizer (None, Parameter, optional) – The (initial) value of the regularizer/prior variance to apply to the regression weights of this basis function. The Parameter object must have a scalar value. If it is not set, it will take on a default value of Parameter(gamma(1.), Positive()).
__init__(onescol=True, regularizer=None)

See this class’s docstring.

Methods

__init__([onescol, regularizer]) See this class’s docstring.
get_dim(X) Get the output dimensionality of this basis.
grad(X) Return the gradient of the basis function for each parameter.
params_values() Get a list of the Parameter values if they have a value.
regularizer_diagonal(X[, regularizer]) Get the diagonal of the prior variance on the weights (regularizer).
transform(X) Return this basis applied to X.

Attributes

params Get this basis’ Parameter types.
regularizer Get the Parameter value of this basis’ regularizer.