Skip to content

Commit 5cdcf22

Browse files
committed
changes made based on review comments
1 parent 417a7d4 commit 5cdcf22

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

python/pyspark/ml/feature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ class Word2Vec(JavaEstimator, HasStepSize, HasMaxIter, HasSeed, HasInputCol, Has
21742174
"the minimum number of times a token must appear to be included in the " +
21752175
"word2vec model's vocabulary", typeConverter=TypeConverters.toInt)
21762176
windowSize = Param(Params._dummy(), "windowSize",
2177-
"the window size (context words from [-window, window])",
2177+
"the window size (context words from [-window, window]). Default value is 5",
21782178
typeConverter=TypeConverters.toInt)
21792179

21802180
@keyword_only
@@ -2253,7 +2253,7 @@ def setWindowSize(self, value):
22532253
"""
22542254
Sets the value of :py:attr:`windowSize`.
22552255
"""
2256-
self._paramMap[self.windowSize] = value
2256+
self._set(windowSize=value)
22572257
return self
22582258

22592259
@since("2.0.0")

python/pyspark/ml/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ def test_param_property_error(self):
340340
self.assertEqual(len(params), 1)
341341

342342
def test_word2vec_param(self):
343-
model = Word2Vec() \
344-
.setWindowSize(6)
343+
model = Word2Vec().setWindowSize(6)
345344
# Check windowSize is set properly
346345
self.assertEqual(model.getWindowSize(), 6)
347346

0 commit comments

Comments
 (0)