Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
MechCoder committed Jun 18, 2015
1 parent 5d9fe61 commit 81482fd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions python/pyspark/mllib/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,23 +445,15 @@ def predictOn(self, dstream):
Returns a transformed dstream object
"""
self._validate(dstream)

def predict(ds):
return self.latestModel.predict(ds)

return dstream.map(predict)
return dstream.map(lambda x: self.latestModel.predict(x))

def predictOnValues(self, dstream):
"""
Make predictions on a keyed dstream.
Returns a transformed dstream object.
"""
self._validate(dstream)

def predict(ds):
return self.latestModel.predict(ds)

return dstream.mapValues(predict)
return dstream.mapValues(lambda x: self.latestModel.predict(x))


def _test():
Expand Down

0 comments on commit 81482fd

Please sign in to comment.