Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
changes made based on review comments
  • Loading branch information
jasoncl committed Apr 18, 2016
commit 5cdcf22cf0090e3f58b5f1b19c18c350cd6e2d5c
4 changes: 2 additions & 2 deletions python/pyspark/ml/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ class Word2Vec(JavaEstimator, HasStepSize, HasMaxIter, HasSeed, HasInputCol, Has
"the minimum number of times a token must appear to be included in the " +
"word2vec model's vocabulary", typeConverter=TypeConverters.toInt)
windowSize = Param(Params._dummy(), "windowSize",
"the window size (context words from [-window, window])",
"the window size (context words from [-window, window]). Default value is 5",
typeConverter=TypeConverters.toInt)

@keyword_only
Expand Down Expand Up @@ -2253,7 +2253,7 @@ def setWindowSize(self, value):
"""
Sets the value of :py:attr:`windowSize`.
"""
self._paramMap[self.windowSize] = value
self._set(windowSize=value)
return self

@since("2.0.0")
Expand Down
3 changes: 1 addition & 2 deletions python/pyspark/ml/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ def test_param_property_error(self):
self.assertEqual(len(params), 1)

def test_word2vec_param(self):
model = Word2Vec() \
.setWindowSize(6)
model = Word2Vec().setWindowSize(6)
# Check windowSize is set properly
self.assertEqual(model.getWindowSize(), 6)

Expand Down