Package paramz :: Package examples :: Module ridge_regression :: Class Polynomial
[hide private]
[frames] | no frames]

Class Polynomial

source code


Instance Methods [hide private]
 
__init__(self, degree, name='polynomial')
Basis class for computing the design matrix phi(X).
source code
 
basis(self, X, i)
Return the ith basis dimension.
source code

Inherited from parameterized.Parameterized: __getitem__, __setattr__, __setitem__, __setstate__, __str__, _repr_html_, build_pydot, copy, get_property_string, grep_param_names, link_parameter, link_parameters, unlink_parameter

Inherited from core.parameter_core.Parameterizable: disable_caching, enable_caching, initialize_parameter, parameters_changed, save, traverse, traverse_parents

Inherited from core.parameter_core.OptimizationHandlable: parameter_names, parameter_names_flat, randomize

Inherited from core.constrainable.Constrainable: constrain, constrain_bounded, constrain_fixed, constrain_negative, constrain_positive, fix, unconstrain, unconstrain_bounded, unconstrain_fixed, unconstrain_negative, unconstrain_positive, unfix

Inherited from core.indexable.Indexable: add_index_operation, remove_index_operation

Inherited from core.nameable.Nameable: hierarchy_name

Inherited from core.gradcheckable.Gradcheckable: checkgrad

Inherited from core.gradcheckable.Gradcheckable (private): _checkgrad

Inherited from core.pickleable.Pickleable: __deepcopy__, __getstate__, pickle

Inherited from core.parentable.Parentable: has_parent

Inherited from core.updateable.Updateable: toggle_update, trigger_update, update_model, update_toggle

Inherited from core.observable.Observable: add_observer, change_priority, notify_observers, remove_observer, set_updates

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from core.parentable.Parentable: _parent_, _parent_index_

Properties [hide private]

Inherited from parameterized.Parameterized: flattened_parameters

Inherited from parameterized.Parameterized (private): _description_str

Inherited from core.parameter_core.Parameterizable: gradient, num_params, param_array, unfixed_param_array

Inherited from core.parameter_core.OptimizationHandlable: gradient_full, optimizer_array

Inherited from core.constrainable.Constrainable: is_fixed

Inherited from core.nameable.Nameable: name

Inherited from core.parentable.Parentable: _highest_parent_

Inherited from object: __class__

Method Details [hide private]

__init__(self, degree, name='polynomial')
(Constructor)

source code 

Basis class for computing the design matrix phi(X). The weights are held in the regularizer, so that this only represents the design matrix.

Overrides: object.__init__
(inherited documentation)

basis(self, X, i)

source code 

Return the ith basis dimension. In the polynomial case, this is X**index. You can write your own basis function here, inheriting from this class and the gradients will still check.

Note: i will be zero for the first degree. This means we have also a bias in the model, which makes the problem of having an explicit bias obsolete.

Overrides: Basis.basis
(inherited documentation)