def test_lda_empty_docs():
 Z = np.zeros((5, 4))
 for X in [Z, csr_matrix(Z)]:
  lda = LatentDirichletAllocation(max_iter=750).fit(X)
  assert_almost_equal(lda.components_.sum(axis=0), np.ones(lda.components_.shape[1]))

def test_lda_empty_docs ( ) : Z = np . zeros ( ( 5 , 4 ) ) for X in [ Z , csr_matrix ( Z ) ] : lda = LatentDirichletAllocation ( max_iter = 750 ) . fit ( X ) assert_almost_equal ( lda . components_ . sum ( axis = 0 ) , np . ones ( lda . components_ . shape [ 1 ] ) )
test lda on empty document .