sklearn.linear_model.orthogonal_mp_gram?

sklearn.linear_model.orthogonal_mp_gram(Gram, Xy, *, n_nonzero_coefs=None, tol=None, norms_squared=None, copy_Gram=True, copy_Xy=True, return_path=False, return_n_iter=False)

[源碼]

Gram正交匹配追蹤(OMP)

僅使用Gram矩陣XT * X和乘積XT * y解決n_targets正交匹配追蹤問題。

用戶指南中閱讀更多內容。

參數 說明
Gram array, shape (n_features, n_features)
輸入數據的Gram矩陣:XT * X
Xy array, shape (n_features,) or (n_features, n_targets)
輸入目標乘以X: X.T * y
n_nonzero_coefs int
解決方案中非零項的期望數目。如果為None(默認情況下),這個值設置為n_features的10%。
tol float
殘差的最大范數。如果不是None,則覆蓋n_nonzero_coefs。
norms_squared array-like, shape (n_targets,)
y線的平方L2范數。如果tol不為None,則需要設置。
copy_Gram bool, optional
gram矩陣是否必須由算法復制。假值只有在它已經被Fortran-ordered時才有用,否則無論如何都會復制。
copy_Xy bool, optional
該算法是否必須復制協方差向量Xy。如果為False,則可能會覆蓋它。
return_path bool, optional. Default: False
是否沿正向路徑返回非零系數的每個值。對于交叉驗證很有用。
return_n_iter bool, optional default False
是否返回迭代次數。
返回值 說明
coef array, shape (n_features,) or (n_features, n_targets)
OMP解決方案的系數。如果為return_path=True,則包含整個系數路徑。在這種情況下,其形狀為(n_features,n_features)或(n_features,n_targets,n_features),并且在最后一個軸上進行迭代會按活動特征的遞增順序生成系數。
n_iters array-like or int
每個目標上的活動特征數量。僅當return_n_iter設置為True時返回 。

另見:

OrthogonalMatchingPursuit

orthogonal_mp

lars_path

decomposition.sparse_encode

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. https://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf