Package parsimony :: Package functions :: Module combinedfunctions :: Class AugmentedLinearRegressionL1L2TV
[hide private]
[frames] | no frames]

Class AugmentedLinearRegressionL1L2TV

source code

                      object --+        
                               |        
             properties.Function --+    
                                   |    
       properties.SplittableFunction --+
                                       |
                      object --+       |
                               |       |
     properties.ProximalOperator --+   |
                                   |   |
properties.AugmentedProximalOperator --+
                                       |
                                      AugmentedLinearRegressionL1L2TV

Combination (sum) of LinearRegression, L1, L2 and 1D TotalVariation
with a linear constraint. Represents the problem

    min. f(b) = g(x)
                + h(r)
              = (1 / 2) ||Xb - y||² + (k / 2) ||b||²
                + l ||r_1||_1 + g ||r_tv||_1,
    s.t. r = Db.

The proximal operators of the splittable functions are assumed to be from
augmented Lagrangians.

Note: This function only works for 1-dimensional total variation.

Parameters
----------
X : Numpy array. The X matrix for the linear regression.

y : Numpy array. The y vector for the linear regression.

l1 : Non-negative float. The Lagrange multiplier, or regularisation
        constant, for the L1 penalty.

l2 : Non-negative float. The Lagrange multiplier, or regularisation
        constant, for the ridge penalty.

tv : Non-negative float. The Lagrange multiplier, or regularisation
        constant, of the total variation function.

A : List or tuple of numpy (or usually sparse scipy) arrays. The linear
        operator for the constraints.

rho : Positive float. The penalty parameter for the augmented Lagrangian.

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.

Instance Methods [hide private]
 
__init__(self, X, y, l1, l2, tv, A=None, rho=1.0, penalty_start=0, mean=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
reset(self)
Free any cached computations from previous use of this Function.
source code
 
f(self, xy)
Function value.
source code
 
prox(self, x, **kwargs)
The proximal operator corresponding to the function.
source code
 
set_rho(self, rho)
Update the penalty parameter.
source code

Inherited from properties.Function: get_params, set_params

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

Class Variables [hide private]

Inherited from properties.SplittableFunction: __abstractmethods__, __metaclass__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, X, y, l1, l2, tv, A=None, rho=1.0, penalty_start=0, mean=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

reset(self)

source code 

Free any cached computations from previous use of this Function.

Overrides: properties.Function.reset
(inherited documentation)

f(self, xy)

source code 

Function value.

Overrides: properties.Function.f
(inherited documentation)

prox(self, x, **kwargs)

source code 
The proximal operator corresponding to the function.

Parameters
----------
x : Numpy array (p-by-1). The point at which to apply the proximal
        operator.

factor : Positive float. A factor by which the Lagrange multiplier is
        scaled. This is usually the step size.

eps : Positive float. This is the stopping criterion for inexact
        proximal methods, where the proximal operator is approximated
        numerically.

max_iter : Positive integer. This is the maximum number of iterations
        for inexact proximal methods, where the proximal operator is
        approximated numerically.

index : Non-negative integer. For multivariate functions, this
        identifies the variable for which the proximal operator is
        associated.

Overrides: properties.ProximalOperator.prox
(inherited documentation)

set_rho(self, rho)

source code 

Update the penalty parameter.

From the interface "AugmentedProximalOperator".

Overrides: properties.AugmentedProximalOperator.set_rho