2

我在 TfIdf 矩阵上拟合 LSA 模型。我的原始矩阵有

(20, 22096) 然后我应用 TruncatedSVD 来执行 LSI/Reduction

svd = TruncatedSVD(n_components=200, random_state=42, n_iter=10) svdProfile = svd.fit_transform(profileLSAVectors) print(np.shape(svdProfile)) #result (20, 20)

而不是得到 (20,200) 我得到 (20, 20)

任何人都知道为什么......?

4

1 回答 1

2

它是 Scikit-learn 中大多数分解过程中的“预期”行为。

我在 TruncatedSVD 的文档中找不到提到这一点,但您可以查看PCA 的文档,其中提到:

n_components == min(n_samples, n_features)

您可以尝试将其发布在scikit-learn github 问题页面上以获得更清晰的信息。

于 2018-03-19T05:37:15.357 回答