Skip to content

Commit cfca011

Browse files
Pengyanboliang
authored andcommitted
[SPARK-20764][ML][PYSPARK] Fix visibility discrepancy with numInstances and degreesOfFreedom in LR and GLR - Python version
## What changes were proposed in this pull request? SPARK-20097 exposed degreesOfFreedom in LinearRegressionSummary and numInstances in GeneralizedLinearRegressionSummary. Python API should be updated to reflect these changes. ## How was this patch tested? The existing UT Author: Peng <[email protected]> Closes #18062 from mpjlu/spark-20764.
1 parent f3ed62a commit cfca011

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

python/pyspark/ml/regression.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ def numInstances(self):
323323
"""
324324
return self._call_java("numInstances")
325325

326+
@property
327+
@since("2.2.0")
328+
def degreesOfFreedom(self):
329+
"""
330+
Degrees of freedom.
331+
"""
332+
return self._call_java("degreesOfFreedom")
333+
326334
@property
327335
@since("2.0.0")
328336
def devianceResiduals(self):
@@ -1565,6 +1573,14 @@ def predictionCol(self):
15651573
"""
15661574
return self._call_java("predictionCol")
15671575

1576+
@property
1577+
@since("2.2.0")
1578+
def numInstances(self):
1579+
"""
1580+
Number of instances in DataFrame predictions.
1581+
"""
1582+
return self._call_java("numInstances")
1583+
15681584
@property
15691585
@since("2.0.0")
15701586
def rank(self):

0 commit comments

Comments
 (0)