SparseMethod¶
-
class
SparseMethod
(*args)¶ Least squares solver using a sparse representation.
- Available constructors:
SparseMethod(method)
SparseMethod(method, basisSequenceFactory, fittingAlgorithm)
- Parameters
- method
LeastSquaresMethod
Least squares resolution method
- basisSequenceFactory
BasisSequenceFactory
Basis enumeration algorithm
- fittingAlgorithm
FittingAlgorithm
Validation algorithm
- method
See also
Methods
computeWeightedDesign
(self[, whole])Build the design matrix.
getBasis
(self)Accessor to the basis.
getClassName
(self)Accessor to the object’s name.
getCurrentIndices
(self)Current indices accessor.
getGramInverse
(self)Get the inverse Gram matrix of input sample.
getGramInverseDiag
(self)Get the diagonal of the inverse Gram matrix.
getGramInverseTrace
(self)Get the trace of the inverse Gram matrix.
getH
(self)Get the projection matrix H.
getHDiag
(self)Get the diagonal of the projection matrix H.
getId
(self)Accessor to the object’s id.
getInitialIndices
(self)Initial indices accessor.
getInputSample
(self)Input sample accessor.
getName
(self)Accessor to the object’s name.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVisibility
(self)Accessor to the object’s visibility state.
getWeight
(self)Accessor to the weights.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
setName
(self, name)Accessor to the object’s name.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
solve
(self, rhs)Solve the least-squares problem.
solveNormal
(self, rhs)Solve the least-squares problem using normal equation.
trashDecomposition
(self)Drop the current decomposition.
update
(self, addedIndices, conservedIndices, …)Update the current decomposition.
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
computeWeightedDesign
(self, whole=False)¶ Build the design matrix.
- Parameters
- wholebool, defaults to False
Whether to use the initial indices instead of the current indices
- Returns
- psiAk
Matrix
The design matrix
- psiAk
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getCurrentIndices
(self)¶ Current indices accessor.
- Returns
- indices
Indices
Indices of the current decomposition in the global basis.
- indices
-
getGramInverse
(self)¶ Get the inverse Gram matrix of input sample.
- Returns
- c
CovarianceMatrix
The inverse Gram matrix.
- c
-
getGramInverseDiag
(self)¶ Get the diagonal of the inverse Gram matrix.
- Returns
- d
Point
The diagonal of the inverse Gram matrix.
- d
-
getGramInverseTrace
(self)¶ Get the trace of the inverse Gram matrix.
- Returns
- x
Scalar
The trace of inverse Gram matrix.
- x
-
getH
(self)¶ Get the projection matrix H.
- Returns
- h
SymmetricMatrix
The projection matrix H.
- h
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getInitialIndices
(self)¶ Initial indices accessor.
- Returns
- indices
Indices
Initial indices of the terms in the global basis.
- indices
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
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.
-
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.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.
-
solve
(self, rhs)¶ Solve the least-squares problem.
- Parameters
- bsequence of float
Second term of the equation
- Returns
- a
Point
The solution.
- a
-
solveNormal
(self, rhs)¶ Solve the least-squares problem using normal equation.
- Parameters
- bsequence of float
Second term of the equation
- Returns
- x
Point
The solution.
- x
-
trashDecomposition
(self)¶ Drop the current decomposition.
-
update
(self, addedIndices, conservedIndices, removedIndices, row=False)¶ Update the current decomposition.
- Parameters
- addedIndicessequence of int
Indices of added basis terms.
- conservedIndicessequence of int
Indices of conserved basis terms.
- removedIndicessequence of int
Indices of removed basis terms.