从单词向量空间到话题向量空间的线性变换:
image.png
image.png
image.png
图例 17.1
import numpy as np
from sklearn.decomposition...import TruncatedSVD
X = [[2, 0, 0, 0], [0, 2, 0, 0], [0, 0, 1, 0], [0, 0, 2, 3], [0, 0, 0, 1], [1,...[-1.26523351e-01, -2.53046702e-01, 7.68672366e-01,
-5.73674125e-01]])
# 截断奇异值分解
svd = TruncatedSVD...(n_components=3, n_iter=7, random_state=42)
svd.fit(X)
TruncatedSVD(algorithm='randomized', n_components...计算
from sklearn.decomposition import NMF
model = NMF(n_components=3, init='random', max_iter=200, random_state