예제 #1
0
파일: test_utils.py 프로젝트: 52nlp/lda-1
 def test_lists_to_matrix_sparse(self):
     dtm = self.dtm_sparse
     WS, DS = utils.matrix_to_lists(dtm)
     dtm_new = utils.lists_to_matrix(WS, DS)
     self.assertTrue(np.all(dtm == dtm_new))
예제 #2
0
 def subprocess(self, key):
   model = PyLDA(n_topics=20, n_iter=1)
   words, documents, wordsDict = self.normalize(key)
   matrix = lists_to_matrix(words, documents)
   model.fit_transform(matrix)
   return (model, documents, wordsDict)
예제 #3
0
파일: test_utils.py 프로젝트: nvdnkpr/lda
 def test_lists_to_matrix(self):
     dtm = self.dtm
     WS, DS = utils.matrix_to_lists(dtm)
     dtm_new = utils.lists_to_matrix(WS, DS)
     self.assertTrue(np.all(dtm == dtm_new))