Repository: spark
Updated Branches:
  refs/heads/master c98a93ded -> 4460113d4


[SPARK-13490][ML] ML LinearRegression should cache standardization param value

## What changes were proposed in this pull request?
Like #11027 for ```LogisticRegression```, ```LinearRegression``` with L1 
regularization should also cache the value of the ```standardization``` rather 
than re-fetching it from the ```ParamMap``` for every OWLQN iteration.
cc srowen

## How was this patch tested?
No extra tests are added. It should pass all existing tests.

Author: Yanbo Liang <yblia...@gmail.com>

Closes #11367 from yanboliang/spark-13490.


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

Branch: refs/heads/master
Commit: 4460113d419b5da47ba3c956b8430fd00eb03217
Parents: c98a93d
Author: Yanbo Liang <yblia...@gmail.com>
Authored: Thu Feb 25 13:34:29 2016 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Thu Feb 25 13:34:29 2016 +0000

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/regression/LinearRegression.scala   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4460113d/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala 
b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
index e253f25..ccfb5c4 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
@@ -277,8 +277,9 @@ class LinearRegression @Since("1.3.0") (@Since("1.3.0") 
override val uid: String
     val optimizer = if ($(elasticNetParam) == 0.0 || effectiveRegParam == 0.0) 
{
       new BreezeLBFGS[BDV[Double]]($(maxIter), 10, $(tol))
     } else {
+      val standardizationParam = $(standardization)
       def effectiveL1RegFun = (index: Int) => {
-        if ($(standardization)) {
+        if (standardizationParam) {
           effectiveL1RegParam
         } else {
           // If `standardization` is false, we still standardize the data


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

Reply via email to