8.15.1.25. sklearn.linear_model.orthogonal_mp¶
- sklearn.linear_model.orthogonal_mp(X, y, n_nonzero_coefs=None, tol=None, precompute_gram=False, copy_X=True)¶
Orthogonal Matching Pursuit (OMP)
Solves n_targets Orthogonal Matching Pursuit problems. An instance of the problem has the form:
When parametrized by the number of non-zero coefficients using n_nonzero_coefs: argmin ||y - Xgamma||^2 subject to ||gamma||_0 <= n_{nonzero coefs}
When parametrized by error using the parameter tol: argmin ||gamma||_0 subject to ||y - Xgamma||^2 <= tol
Parameters : X: array, shape = (n_samples, n_features) :
Input data. Columns are assumed to have unit norm.
y: array, shape = (n_samples,) or (n_samples, n_targets) :
Input targets
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.
precompute_gram: {True, False, ‘auto’}, :
Whether to perform precomputations. Improves performance when n_targets or n_samples is very large.
copy_X: bool, optional :
Whether the design matrix X must be copied by the algorithm. A false value is only helpful if X is already Fortran-ordered, otherwise a copy is made anyway.
Returns : coef: array, shape = (n_features,) or (n_features, n_targets) :
Coefficients of the OMP solution
See also
OrthogonalMatchingPursuit, orthogonal_mp_gram, 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/KSVD-OMP-v2.pdf