sklearns OMP中的“字典中的线性相关性”异常

oba*_*tos 5 python compression machine-learning scikit-learn

我正在使用sklearns OrthogonalMatchingPursuit通过使用KSVD 算法学习的字典来获得信号的稀疏编码。但是,在拟合过程中,我得到以下RuntimeWarning:

/usr/local/lib/python2.7/dist-packages/sklearn/linear_model/omp.py:391: RuntimeWarning:  Orthogonal matching pursuit ended prematurely due to linear
dependence in the dictionary. The requested precision might not have been met.

  copy_X=copy_X, return_path=return_path)
Run Code Online (Sandbox Code Playgroud)

在那些情况下,结果确实不令人满意。我没有得到这个警告的要点,因为在稀疏编码中通常有一个不完整的字典,因此字典中也存在线性依赖性。对于OMP而言,这不应该成为问题。实际上,如果字典是方矩阵,也会发出警告。

此警告可能还会指出应用程序中的其他问题吗?

oba*_*tos 4

问题出在数据向量y

omp = OrthogonalMatchingPursuit(n_nonzero_coefs=target_sparsity)
omp.fit(D, y)
Run Code Online (Sandbox Code Playgroud)

它包含的数字非常小。当我标准化时yD拟合效果达到了预期的精度。