PenalizedLeastSquaresAlgorithm

class PenalizedLeastSquaresAlgorithm(*args)

Penalized least squares algorithm.

Refer to Least squares problems numerical methods.

Available constructors:

PenalizedLeastSquaresAlgorithm(x, y, psi, indices, penalizationFactor=0, useNormal=False)

PenalizedLeastSquaresAlgorithm(x, y, weight, psi, indices, penalizationFactor=0, useNormal=False)

PenalizedLeastSquaresAlgorithm(x, y, weight, psi, indices, penalizationFactor=0, penalizationMatrix, useNormal=False)

Parameters
xSample

Input sample

ySample

Output sample

weightsequence of float

Output weights

psisequence of Function

Basis

indicessequence of int

Indices allowed in the basis

penalizationFactorfloat, optional

Penalization factor

penalizationMatrix2-d sequence of float

Penalization matrix

useNormalbool, optional

Solve the normal equation

Notes

Solve the least-squares problem:

\vect{a} = \argmin_{\vect{b} \in \Rset^P} ||y - \vect{b}^{\intercal} \vect{\Psi}(\vect{U})||^2

Methods

getClassName(self)

Accessor to the object’s name.

getCoefficients(self)

Accessor to the coefficients.

getId(self)

Accessor to the object’s id.

getName(self)

Accessor to the object’s name.

getPsi(self)

Accessor to the basis.

getRelativeError(self)

Accessor to the coefficients.

getResidual(self)

Accessor to the coefficients.

getShadowedId(self)

Accessor to the object’s shadowed id.

getVerbose(self)

Accessor to the verbosity flag.

getVisibility(self)

Accessor to the object’s visibility state.

getWeight(self)

Accessor to the weights.

getX(self)

Accessor to the input sample.

getY(self)

Accessor to the output sample.

hasName(self)

Test if the object is named.

hasVisibleName(self)

Test if the object has a distinguishable name.

run(self)

Run the algorithm.

setName(self, name)

Accessor to the object’s name.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

setVerbose(self, verbose)

Accessor to the verbosity flag.

setVisibility(self, visible)

Accessor to the object’s visibility state.

__init__(self, *args)

Initialize self. See help(type(self)) for accurate signature.

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getCoefficients(self)

Accessor to the coefficients.

Returns
coefficientsPoint

The coefficients

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getPsi(self)

Accessor to the basis.

Returns
coefficientsBasis

The basis

getRelativeError(self)

Accessor to the coefficients.

Returns
relativeErrorfloat

The relative error

getResidual(self)

Accessor to the coefficients.

Returns
coefficientsfloat

The residual

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getVerbose(self)

Accessor to the verbosity flag.

Returns
vbool.

Verbosity

getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

getWeight(self)

Accessor to the weights.

Returns
weightPoint

Output weights

getX(self)

Accessor to the input sample.

Returns
xSample

Input sample

getY(self)

Accessor to the output sample.

Returns
ySample

Input sample

hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

run(self)

Run the algorithm.

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setVerbose(self, verbose)

Accessor to the verbosity flag.

Parameters
vbool

Enable or disable the verbosity.

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.