# PenalizedLeastSquaresAlgorithm¶

class PenalizedLeastSquaresAlgorithm(*args)

Penalized least squares algorithm.

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: x : Sample Input sample y : Sample Output sample weight : sequence of float Output weights psi : sequence of Function Basis indices : sequence of int Indices allowed in the basis penalizationFactor : float, optional Penalization factor penalizationMatrix : 2-d sequence of float Penalization matrix useNormal : bool, optional Solve the normal equation

Notes

Solve the least-squares problem:

Methods

 getClassName() Accessor to the object’s name. getCoefficients() Accessor to the coefficients. getId() Accessor to the object’s id. getName() Accessor to the object’s name. getPsi() Accessor to the basis. getRelativeError() Accessor to the coefficients. getResidual() Accessor to the coefficients. getShadowedId() Accessor to the object’s shadowed id. getVerbose() Accessor to the verbosity flag. getVisibility() Accessor to the object’s visibility state. getWeight() Accessor to the weights. getX() Accessor to the input sample. getY() Accessor to the output sample. hasName() Test if the object is named. hasVisibleName() Test if the object has a distinguishable name. run() Run the algorithm. setName(name) Accessor to the object’s name. setShadowedId(id) Accessor to the object’s shadowed id. setVerbose(verbose) Accessor to the verbosity flag. setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)

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

getClassName()

Accessor to the object’s name.

Returns: class_name : str The object class name (object.__class__.__name__).
getCoefficients()

Accessor to the coefficients.

Returns: coefficients : Point The coefficients
getId()

Accessor to the object’s id.

Returns: id : int Internal unique identifier.
getName()

Accessor to the object’s name.

Returns: name : str The name of the object.
getPsi()

Accessor to the basis.

Returns: coefficients : Basis The basis
getRelativeError()

Accessor to the coefficients.

Returns: relativeError : float The relative error
getResidual()

Accessor to the coefficients.

Returns: coefficients : float The residual
getShadowedId()

Accessor to the object’s shadowed id.

Returns: id : int Internal unique identifier.
getVerbose()

Accessor to the verbosity flag.

Returns: v : bool. Verbosity
getVisibility()

Accessor to the object’s visibility state.

Returns: visible : bool Visibility flag.
getWeight()

Accessor to the weights.

Returns: weight : Point Output weights
getX()

Accessor to the input sample.

Returns: x : Sample Input sample
getY()

Accessor to the output sample.

Returns: y : Sample Input sample
hasName()

Test if the object is named.

Returns: hasName : bool True if the name is not empty.
hasVisibleName()

Test if the object has a distinguishable name.

Returns: hasVisibleName : bool True if the name is not empty and not the default one.
run()

Run the algorithm.

setName(name)

Accessor to the object’s name.

Parameters: name : str The name of the object.
setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters: id : int Internal unique identifier.
setVerbose(verbose)

Accessor to the verbosity flag.

Parameters: v : bool Enable or disable the verbosity.
setVisibility(visible)

Accessor to the object’s visibility state.

Parameters: visible : bool Visibility flag.