def test_get_phi_topic_from_memory():
sampler2 = GibbsSampler(corpus, nTopics=3, nIter=5)
sampler2._initialize()
sampler2.run()
f = sampler2.get_phi_topic_file_name(0)
yield assert_false, os.path.isfile(f)
phi = sampler2.get_phi_topic()
yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)
phi = sampler2.get_phi_topic(index=2)
yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)
phi = sampler2.get_phi_topic(start=0, end=5)
yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)
评论列表
文章目录