This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new e44f308  [SPARK-26787] Fix standardizeLabels error message in 
WeightedLeastSquares
e44f308 is described below

commit e44f308593e8cb02cdaeb5533f387c465aa60c6c
Author: bscan <brianjscann...@gmail.com>
AuthorDate: Thu Jan 31 19:50:18 2019 -0600

    [SPARK-26787] Fix standardizeLabels error message in WeightedLeastSquares
    
    Error message falsely states standardization=True is causing a problem, 
even when standardization=False. The real issue is standardizeLabels=True, 
which is set automatically in LinearRegression and not currently available in 
the Public API.
    
    ## What changes were proposed in this pull request?
    
    A simple change to an error message. More details here: 
https://jira.apache.org/jira/browse/SPARK-26787
    
    ## How was this patch tested?
    
    This does not change any functionality.
    
    Closes #23705 from bscan/bscan-errormsg-1.
    
    Authored-by: bscan <brianjscann...@gmail.com>
    Signed-off-by: Sean Owen <sean.o...@databricks.com>
---
 .../src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala 
b/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
index 134d6a9..9f32603 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
@@ -133,7 +133,7 @@ private[ml] class WeightedLeastSquares(
         return new WeightedLeastSquaresModel(coefficients, intercept, 
diagInvAtWA, Array(0D))
       } else {
         require(!(regParam > 0.0 && standardizeLabel), "The standard deviation 
of the label is " +
-          "zero. Model cannot be regularized with standardization=true")
+          "zero. Model cannot be regularized when labels are standardized.")
         instr.logWarning(s"The standard deviation of the label is zero. 
Consider setting " +
           s"fitIntercept=true.")
       }


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

Reply via email to