Skip to content

Commit e44f308

Browse files
bscansrowen
authored andcommitted
[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 apache#23705 from bscan/bscan-errormsg-1. Authored-by: bscan <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent f7d87b1 commit e44f308

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private[ml] class WeightedLeastSquares(
133133
return new WeightedLeastSquaresModel(coefficients, intercept, diagInvAtWA, Array(0D))
134134
} else {
135135
require(!(regParam > 0.0 && standardizeLabel), "The standard deviation of the label is " +
136-
"zero. Model cannot be regularized with standardization=true")
136+
"zero. Model cannot be regularized when labels are standardized.")
137137
instr.logWarning(s"The standard deviation of the label is zero. Consider setting " +
138138
s"fitIntercept=true.")
139139
}

0 commit comments

Comments
 (0)