spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject spark git commit: [SPARK-13490][ML] ML LinearRegression should cache standardization param value
Date Thu, 25 Feb 2016 13:34:34 GMT
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 <ybliang8@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 <ybliang8@gmail.com>
Authored: Thu Feb 25 13:34:29 2016 +0000
Committer: Sean Owen <sowen@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-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message