This page

Citing

Please consider citing the scikit-learn.

9.2.22. sklearn.linear_model.orthogonal_mp_gram

sklearn.linear_model.orthogonal_mp_gram(Gram, Xy, n_nonzero_coefs=None, tol=None, norms_squared=None, overwrite_gram=False, overwrite_Xy=False)

Gram Orthogonal Matching Pursuit (OMP)

Solves n_targets Orthogonal Matching Pursuit problems using only the Gram matrix X.T * X and the product X.T * y.

Parameters :

Gram: array, shape = (n_features, n_features) :

Gram matrix of the input data: X.T * X

Xy: array, shape = (n_features,) or (n_features, n_targets) :

Input targets multiplied by X: X.T * y

n_nonzero_coefs: int :

Desired number of non-zero entries in the solution. If None (by default) this value is set to 10% of n_features.

tol: float :

Maximum norm of the residual. If not None, overrides n_nonzero_coefs.

norms_squared: array-like, shape = (n_targets,) :

Squared L2 norms of the lines of y. Required if tol is not None.

overwrite_gram: bool, :

Whether the gram matrix can be overwritten by the algorithm. This is only helpful if it is already Fortran-ordered, otherwise a copy is made anyway.

overwrite_Xy: bool, :

Whether the covariance vector Xy can be overwritten by the algorithm.

Returns :

coef: array, shape = (n_features,) or (n_features, n_targets) :

Coefficients of the OMP solution

See also

OrthogonalMatchingPursuit, orthogonal_mp, lars_path, decomposition.sparse_encode, decomposition.sparse_encode_parallel

Notes

Orthogonal matching pursuit was introduced in G. Mallat, Z. Zhang, Matching pursuits with time-frequency dictionaries, IEEE Transactions on Signal Processing, Vol. 41, No. 12. (December 1993), pp. 3397-3415. (http://blanche.polytechnique.fr/~mallat/papiers/MallatPursuit93.pdf)

This implementation is based on Rubinstein, R., Zibulevsky, M. and Elad, M., Efficient Implementation of the K-SVD Algorithm using Batch Orthogonal Matching Pursuit Technical Report - CS Technion, April 2008. http://www.cs.technion.ac.il/~ronrubin/Publications/KSVX-OMP-v2.pdf