python - numpy svd : is there a way to find only the first singular vectors instead of doing full svd?

标签 python numpy scipy scikit-learn svd

numpy.linalg.svd 函数给出输入矩阵的完整 svd。 但是我只想要第一个奇异向量。

我想知道在 numpy 中是否有任何函数用于那个或 python 中的任何其他库?

最佳答案

一种可能是sklearn.utils.extmath.randomized_svd

from sklearn.utils.extmath import randomized_svd
U, S, Vt = randomized_svd(X, n_components=1)

关于python - numpy svd : is there a way to find only the first singular vectors instead of doing full svd?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36630694/

相关文章:

python - 为什么enthought mkl例程比matlab慢

python - 理解 eventlet.wsgi.server

python - 通过HTTP的Python网络摄像头图像服务器未显示图像

python - 使用一维 bool 数组过滤二维数组

python - 在每个 pandas 数据框行中查找最高值列的名称——包括绑定(bind)值

python - NumPy 的/科学的 : How to re-construct an ndarray?

Numpy/Scipy - 稀疏矩阵到向量

python - 如何使用wxpython获得禁用按钮的点击?

python - 如何在 Windows 8 中拥有合适的 tkinter 窗口?

python - numpy linspace 和 numpy logspace 之间的输出差异