spark git commit: [SPARK-20764][ML][PYSPARK] Fix visibility discrepancy with numInstances and degreesOfFreedom in LR and GLR - Python version

2017-05-22 Thread yliang
Repository: spark
Updated Branches:
  refs/heads/branch-2.2 a57553279 -> a0bf5c47c


[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 

Closes #18062 from mpjlu/spark-20764.

(cherry picked from commit cfca01136bd7443c1d9daf8e8e256635eec20ddc)
Signed-off-by: Yanbo Liang 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a0bf5c47
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a0bf5c47
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a0bf5c47

Branch: refs/heads/branch-2.2
Commit: a0bf5c47cb9c72d73616f876a4521ae80e2e4ecb
Parents: a575532
Author: Peng 
Authored: Mon May 22 22:42:37 2017 +0800
Committer: Yanbo Liang 
Committed: Mon May 22 22:42:56 2017 +0800

--
 python/pyspark/ml/regression.py | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/a0bf5c47/python/pyspark/ml/regression.py
--
diff --git a/python/pyspark/ml/regression.py b/python/pyspark/ml/regression.py
index 3c3fcc8..2d17f95 100644
--- a/python/pyspark/ml/regression.py
+++ b/python/pyspark/ml/regression.py
@@ -324,6 +324,14 @@ class LinearRegressionSummary(JavaWrapper):
 return self._call_java("numInstances")
 
 @property
+@since("2.2.0")
+def degreesOfFreedom(self):
+"""
+Degrees of freedom.
+"""
+return self._call_java("degreesOfFreedom")
+
+@property
 @since("2.0.0")
 def devianceResiduals(self):
 """
@@ -1566,6 +1574,14 @@ class GeneralizedLinearRegressionSummary(JavaWrapper):
 return self._call_java("predictionCol")
 
 @property
+@since("2.2.0")
+def numInstances(self):
+"""
+Number of instances in DataFrame predictions.
+"""
+return self._call_java("numInstances")
+
+@property
 @since("2.0.0")
 def rank(self):
 """


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-20764][ML][PYSPARK] Fix visibility discrepancy with numInstances and degreesOfFreedom in LR and GLR - Python version

2017-05-22 Thread yliang
Repository: spark
Updated Branches:
  refs/heads/master f3ed62a38 -> cfca01136


[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 

Closes #18062 from mpjlu/spark-20764.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/cfca0113
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/cfca0113
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/cfca0113

Branch: refs/heads/master
Commit: cfca01136bd7443c1d9daf8e8e256635eec20ddc
Parents: f3ed62a
Author: Peng 
Authored: Mon May 22 22:42:37 2017 +0800
Committer: Yanbo Liang 
Committed: Mon May 22 22:42:37 2017 +0800

--
 python/pyspark/ml/regression.py | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/cfca0113/python/pyspark/ml/regression.py
--
diff --git a/python/pyspark/ml/regression.py b/python/pyspark/ml/regression.py
index 3c3fcc8..2d17f95 100644
--- a/python/pyspark/ml/regression.py
+++ b/python/pyspark/ml/regression.py
@@ -324,6 +324,14 @@ class LinearRegressionSummary(JavaWrapper):
 return self._call_java("numInstances")
 
 @property
+@since("2.2.0")
+def degreesOfFreedom(self):
+"""
+Degrees of freedom.
+"""
+return self._call_java("degreesOfFreedom")
+
+@property
 @since("2.0.0")
 def devianceResiduals(self):
 """
@@ -1566,6 +1574,14 @@ class GeneralizedLinearRegressionSummary(JavaWrapper):
 return self._call_java("predictionCol")
 
 @property
+@since("2.2.0")
+def numInstances(self):
+"""
+Number of instances in DataFrame predictions.
+"""
+return self._call_java("numInstances")
+
+@property
 @since("2.0.0")
 def rank(self):
 """


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org