revrand.basis_functions.PolynomialBasis¶
-
class
revrand.basis_functions.
PolynomialBasis
(order, include_bias=True, regularizer=None)¶ Polynomial basis class.
This essentially creates the concatenation,
\[\phi(\mathbf{X}) = [\mathbf{1}, \mathbf{X}^1, \ldots, \mathbf{X}^p]\]where \(p\) is the
order
of the polynomial.Parameters: - order (int) – the order of the polynomial to create.
- include_bias (bool, optional) – If True (default), include the bias column (column of ones which acts as the intercept term in a linear model)
- 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__
(order, include_bias=True, regularizer=None)¶ See this class’s docstring.
Methods
__init__
(order[, include_bias, 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.