2 回答
MMTTMM
TA贡献1869条经验 获得超4个赞
安装
$ pip install lda --user
示例
from __future__ import division, print_function
import numpy as np
import lda
import lda.datasets
# document-term matrix
X = 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]]
'''
忽然笑
TA贡献1806条经验 获得超5个赞
参数:formula
A 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 + ...也就是说,响应分组因素,并在右侧指定鉴(非因子)。
添加回答
举报
0/150
提交
取消