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/