Skip to content

Commit 50ae7b1

Browse files
committed
fixed a bug in marginal calculation tests
1 parent 71c8381 commit 50ae7b1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_tmplot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,14 @@ def test_calc_topics_marg_probs(self):
105105
self.assertEqual(topics_marg_probs.sum(), 1)
106106

107107
def test_calc_terms_marg_probs(self):
108-
term_marg_prob = tm.calc_terms_marg_probs(self.phi, 0)
108+
term_marg_prob = tm.calc_terms_marg_probs(
109+
self.phi, tm.calc_topics_marg_probs(self.theta), 0
110+
)
109111
self.assertIsInstance(term_marg_prob, floating)
110112
self.assertGreater(term_marg_prob, 0)
111-
terms_marg_probs = tm.calc_terms_marg_probs(self.phi)
113+
terms_marg_probs = tm.calc_terms_marg_probs(
114+
self.phi, tm.calc_topics_marg_probs(self.theta)
115+
)
112116
self.assertIsInstance(terms_marg_probs, ndarray)
113117
self.assertEqual(terms_marg_probs.size, self.phi.index.size)
114118

0 commit comments

Comments
 (0)