-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using numpy.random.RandomState instead of numpy.random in LDA #748
Conversation
Please add tests for this particular function(checking both initializaitons work). Also need to update existing tests that fix random seed to use this new API, for example https://github.com/RaRe-Technologies/gensim/blob/develop/gensim/test/test_ldamodel.py#L253 |
Just need to add |
topcis, topn -> num_topics, num_words to match LdaModel
@@ -586,6 +586,7 @@ def show_topics(self, num_topics=10, num_words=10, log=False, formatted=True): | |||
if num_topics < 0: | |||
num_topics = len(self.data) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the line
def testRandomState(): | ||
testcases = [numpy.random.seed(0), None, numpy.random.RandomState(0), 0] | ||
for testcase in testcases: | ||
assert(isinstance(ldamodel.check_random_state(testcase), numpy.random.RandomState)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a test assertEqual(ldamodel.check_random_state(testcase), numpy.random.RandomState(0))
@@ -97,7 +98,7 @@ def testAlpha(self): | |||
expected_shape = (2,) | |||
|
|||
# should not raise anything | |||
self.class_(**kwargs) | |||
self.class_(**kwarghs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piskvorky it was an accident, it was fixed in 8ea4d58 |
In reference to #113 , a random_state parameter has been added to the LdaState initializer and a check_random_seed method as well to check the seed. The check_random_state method was taken from maciejkula/glove-python@95a04af , should I rewrite the method?