Skip to content
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

Merged
merged 35 commits into from
Jun 25, 2016
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1c63c9a
Merge branch 'release-0.12.3rc1'
tmylk Nov 5, 2015
280a488
Merge branch 'release-0.12.3'
tmylk Nov 6, 2015
ddeb002
Merge branch 'release-0.12.3'
tmylk Nov 6, 2015
f2ac3a9
Update CHANGELOG.txt
tmylk Nov 6, 2015
cf09e8c
Update CHANGELOG.txt
tmylk Nov 6, 2015
b61287a
resolve merge conflict in Changelog
tmylk Jan 29, 2016
3ade404
Merge branch 'release-0.12.4' with #596
tmylk Jan 31, 2016
9e6522e
Merge branch 'release-0.13.0'
tmylk Jun 10, 2016
87c4e9c
Merge branch 'release-0.13.0'
tmylk Jun 10, 2016
9c74b40
Release version typo fix
tmylk Jun 10, 2016
7b30025
Merge branch 'release-0.13.0rc1'
tmylk Jun 10, 2016
716d25d
numpy.random -> numpy.random_state
droudy Jun 19, 2016
a19d9b1
change added
droudy Jun 20, 2016
b4311d0
added some documentation
droudy Jun 20, 2016
6ae98a1
fixed type
droudy Jun 20, 2016
de79c8e
Merge branch 'release-0.13.0'
tmylk Jun 22, 2016
77bb575
Updated tests to use new api
droudy Jun 22, 2016
78c9961
Added a test for check_random_state?
droudy Jun 22, 2016
6606ab2
Added test for check_random_state?
droudy Jun 22, 2016
d4f9cc5
Merge branch 'release-0.13.1'
tmylk Jun 23, 2016
f5a749c
topcis, topn -> num_topics, num_words to match LdaModel
droudy Jun 23, 2016
c9369ea
Merge pull request #1 from droudy/param-change
droudy Jun 24, 2016
78d8072
Parameter change in test_dtm for show_topics
droudy Jun 24, 2016
7f5515a
Added a test for check_random_state?
droudy Jun 22, 2016
0648827
topcis, topn -> num_topics, num_words to match LdaModel
droudy Jun 23, 2016
f6e5771
Merge branch 'develop' of https://github.com/droudy/gensim into develop
droudy Jun 24, 2016
3fd444c
random_state parameter added to ldamulticore
droudy Jun 24, 2016
238d537
Merge remote-tracking branch 'upstream/master' into droudy-patch-1
droudy Jun 24, 2016
35a45e4
Merge remote-tracking branch 'upstream/develop' into develop
droudy Jun 24, 2016
c69f9c4
Merge branch 'develop' into droudy-patch-1
droudy Jun 24, 2016
8ea4d58
typo
droudy Jun 24, 2016
75815a5
removed extra line
droudy Jun 24, 2016
6d8c2f9
check_random_state() changed to get_random_state()
droudy Jun 24, 2016
98786ed
Another assert added to test
droudy Jun 24, 2016
d46284a
updated method call
droudy Jun 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changes
* topics, topn parameters changed to num_topics and num_words in show_topics() and print_topics()(@droudy, #747)
- In hdpmodel and dtmmodel
- NOT BACKWARDS COMPATIBLE!
* Added random_state parameter to LdaState initializer and check_random_state() (@droudy, #113)

0.13.1, 2016-06-22

Expand Down Expand Up @@ -36,7 +37,9 @@ Changes
* Tests for wikidump (@jonmcoe, #723)
* Mallet wrapper sparse format support (@RishabGoel, #664)
* Doc2vec pre-processing script translated from bash to Python (@andrewjlm, #720)
* Added random_state parameter to LdaState initializer and check_random_state() (@droudy, #113)


0.12.4, 2016-01-29

* Better internal handling of job batching in word2vec (#535)
- up to 300% speed up when training on very short documents (~tweets)
Expand Down
1 change: 1 addition & 0 deletions gensim/models/hdpmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the line

num_topics = min(num_topics, len(self.data))

for k in xrange(num_topics):
Expand Down
3 changes: 2 additions & 1 deletion gensim/test/test_ldamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def testfile():
# temporary data will be stored to this file
return os.path.join(tempfile.gettempdir(), 'gensim_models.tst')


def testRandomState():
testcases = [numpy.random.seed(0), None, numpy.random.RandomState(0), 0]
for testcase in testcases:
Expand Down Expand Up @@ -97,7 +98,7 @@ def testAlpha(self):
expected_shape = (2,)

# should not raise anything
self.class_(**kwargs)
self.class_(**kwarghs)
Copy link
Owner

@piskvorky piskvorky Jun 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@droudy @tmylk what is this change? If on purpose, needs a clear comment.


kwargs['alpha'] = 'symmetric'
model = self.class_(**kwargs)
Expand Down