Home | Trees | Indices | Help |
---|
|
object --+ | properties.Function --+ | properties.CompositeFunction --+ | object --+ | | | properties.Gradient --+ | object --+ | | | properties.LipschitzContinuousGradient --+ | object --+ | | | properties.StronglyConvex --+ | object --+ | | | properties.StepSize --+ | RidgeRegression
The Ridge Regression function, i.e. a representation of f(x) = (0.5 / n) * ||Xb - y||²_2 + lambda * 0.5 * ||b||²_2, where ||.||²_2 is the L2 norm.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
__abstractmethods__ =
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Parameters ---------- X : Numpy array (n-by-p). The regressor matrix. y : Numpy array (n-by-1). The regressand vector. k : Non-negative float. The ridge parameter. penalty_start : Non-negative integer. The number of columns, variables etc., to except from penalisation. Equivalently, the first index to be penalised. Default is 0, all columns are included. mean : Boolean. Whether to compute the squared loss or the mean squared loss. Default is True, the mean squared loss.
|
Free any cached computations from previous use of this Function. From the interface "Function".
|
Function value. From the interface "Function". Parameters ---------- beta : Numpy array. Regression coefficient vector. The point at which to evaluate the function.
|
Gradient of the function at beta. From the interface "Gradient". Parameters ---------- beta : Numpy array. The point at which to evaluate the gradient. Examples -------- >>> import numpy as np >>> from parsimony.functions.losses import RidgeRegression >>> >>> np.random.seed(42) >>> X = np.random.rand(100, 150) >>> y = np.random.rand(100, 1) >>> rr = RidgeRegression(X=X, y=y, k=3.14159265) >>> beta = np.random.rand(150, 1) >>> round(np.linalg.norm(rr.grad(beta) ... - rr.approx_grad(beta, eps=1e-4)), 9) 1.3e-08
|
Lipschitz constant of the gradient. From the interface "LipschitzContinuousGradient".
|
Smallest eigenvalue of the corresponding covariance matrix. From the interface "Eigenvalues".
|
Returns the strongly convex parameter for the function. From the interface "StronglyConvex".
|
The step size to use in descent methods. Parameters ---------- beta : Numpy array. The point at which to determine the step size.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:11 2015 | http://epydoc.sourceforge.net |