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.
Read more in the User Guide.
Gram matrix of the input data: X.T * X
.
Input targets multiplied by X
: X.T * y
.
Desired number of non-zero entries in the solution. If None
(by default) this value is set to 10% of n_features.
Maximum squared norm of the residual. If not None
, overrides n_nonzero_coefs
.
Squared L2 norms of the lines of y
. Required if tol
is not None.
Whether the gram matrix must be copied by the algorithm. A False
value is only helpful if it is already Fortran-ordered, otherwise a copy is made anyway.
Whether the covariance vector Xy
must be copied by the algorithm. If False
, it may be overwritten.
Whether to return every value of the nonzero coefficients along the forward path. Useful for cross-validation.
Whether or not to return the number of iterations.
Coefficients of the OMP solution. If return_path=True
, this contains the whole coefficient path. In this case its shape is (n_features, n_features)
or (n_features, n_targets, n_features)
and iterating over the last axis yields coefficients in increasing order of active features.
Number of active features across every target. Returned only if return_n_iter
is set to True.
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. (https://www.di.ens.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. https://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf
Examples
>>> from sklearn.datasets import make_regression >>> from sklearn.linear_model import orthogonal_mp_gram >>> X, y = make_regression(noise=4, random_state=0) >>> coef = orthogonal_mp_gram(X.T @ X, X.T @ y) >>> coef.shape (100,) >>> X[:1,] @ coef array([-78.68])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4