diff options
author | Yanbo Liang <ybliang8@gmail.com> | 2016-02-25 13:34:29 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-02-25 13:34:29 +0000 |
commit | 4460113d419b5da47ba3c956b8430fd00eb03217 (patch) | |
tree | 9348e2db4a7afc592d335ad45e7c89bdc27544c5 /mllib/src | |
parent | c98a93ded36db5da2f3ebd519aa391de90927688 (diff) | |
download | spark-4460113d419b5da47ba3c956b8430fd00eb03217.tar.gz spark-4460113d419b5da47ba3c956b8430fd00eb03217.tar.bz2 spark-4460113d419b5da47ba3c956b8430fd00eb03217.zip |
[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.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala | 3 |
1 files changed, 2 insertions, 1 deletions
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 e253f25c0e..ccfb5c4b9d 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 |