python中的lda包怎么用

python中的lda包怎么用


吃鸡游戏
浏览 1533回答 2
2回答

MMTTMM

安装$ pip install lda --user示例from&nbsp;__future__ import division, print_functionimport numpy as npimport ldaimport lda.datasets# document-term matrixX = lda.datasets.load_reuters()print("type(X): {}".format(type(X)))print("shape: {}\n".format(X.shape))print(X[:5, :5])'''输出:type(X): <type 'numpy.ndarray'>shape: (395L, 4258L)[[ 1 0 1 0 0][ 7 0 2 0 0][ 0 0 0 1 10][ 6 0 1 0 0][ 0 0 0 2 14]]'''

忽然笑

参数:formulaA formula of the form groups ~ x1 + x2 + ... That is, the response is the grouping factor and the right hand side specifies the (non-factor) discriminators.一个公式的形式groups ~ x1 + x2 + ...也就是说,响应分组因素,并在右侧指定鉴(非因子)。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python