Skip to content

Commit

Permalink
Merge branch 'smartirs' of github.com:markroxor/gensim into smartirs
Browse files Browse the repository at this point in the history
  • Loading branch information
markroxor committed Dec 22, 2017
2 parents 0bacc08 + 5b2d37a commit 51e0eb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gensim/test/test_sklearn_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,13 @@ def testTransform(self):

def testSetGetParams(self):
# updating only one param
self.model.set_params(normalize=False)
self.model.set_params(smartirs='nnn')
model_params = self.model.get_params()
self.assertEqual(model_params["normalize"], False)
self.assertEqual(model_params["smartirs"], 'nnn')

# verify that the attributes values are also changed for `gensim_model` after fitting
self.model.fit(self.corpus)
self.assertEqual(getattr(self.model.gensim_model, 'normalize'), False)
self.assertEqual(getattr(self.model.gensim_model, 'smartirs'), 'nnn')

def testPipeline(self):
with open(datapath('mini_newsgroup'), 'rb') as f:
Expand Down
3 changes: 1 addition & 2 deletions gensim/test/test_tfidfmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
class TestTfidfModel(unittest.TestCase):
def setUp(self):
self.corpus = MmCorpus(datapath('testcorpus.mm'))
self.model = tfidfmodel.TfidfModel(self.corpus, normalize=True)

def testTransform(self):
# create the transformation model
Expand Down Expand Up @@ -227,9 +226,9 @@ def TestConsistency(self):

self.assertTrue(np.allclose(transformed_docs[0], expected_docs[0]))
self.assertTrue(np.allclose(transformed_docs[1], expected_docs[1]))

# endclass TestTfidfModel


if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG)
unittest.main()

0 comments on commit 51e0eb9

Please sign in to comment.