Skip to content
Closed
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
Next Next commit
fixed numClasses
  • Loading branch information
Ming Jiang authored and jmwdpk committed Sep 11, 2017
commit 53ac68e24731e405d44d50be70b1c25f2ab9df3d
3 changes: 1 addition & 2 deletions python/pyspark/ml/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,7 @@ def summary(self):
"""
if self.hasSummary:
java_blrt_summary = self._call_java("summary")
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this to java_lrt_summary, as it's not always binary logistic regression.

java_blrt_numClasses = self._call_java("numClasses")
if (java_blrt_numClasses == 2):
if (self.numClasses == 2):
Copy link
Contributor

Choose a reason for hiding this comment

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

if (self.numClasses <= 2)

java_blrt_binarysummary = self._call_java("binarySummary")
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually this is not necessary, we can just wrap java_lrt_summary with BinaryLogisticRegressionTrainingSummary.

return BinaryLogisticRegressionTrainingSummary(java_blrt_binarysummary)
else:
Expand Down