diff options
author | Yanbo Liang <ybliang8@gmail.com> | 2015-10-28 08:50:21 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-10-28 08:50:21 -0700 |
commit | fba9e95452ca0a9b589bc14b27c750c69f482b8d (patch) | |
tree | 944f386177e78ac7d567016d9feb3e3e33f78e01 /mllib/src/main | |
parent | fd9e345ceeff385ba614a16d478097650caa98d0 (diff) | |
download | spark-fba9e95452ca0a9b589bc14b27c750c69f482b8d.tar.gz spark-fba9e95452ca0a9b589bc14b27c750c69f482b8d.tar.bz2 spark-fba9e95452ca0a9b589bc14b27c750c69f482b8d.zip |
[SPARK-11369][ML][R] SparkR glm should support setting standardize
SparkR glm currently support :
```formula, family = c(“gaussian”, “binomial”), data, lambda = 0, alpha = 0```
We should also support setting standardize which has been defined at [design documentation](https://docs.google.com/document/d/10NZNSEurN2EdWM31uFYsgayIPfCFHiuIu3pCWrUmP_c/edit)
Author: Yanbo Liang <ybliang8@gmail.com>
Closes #9331 from yanboliang/spark-11369.
Diffstat (limited to 'mllib/src/main')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala b/mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala index fec61fed3c..21ebf6d916 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala @@ -31,6 +31,7 @@ private[r] object SparkRWrappers { family: String, lambda: Double, alpha: Double, + standardize: Boolean, solver: String): PipelineModel = { val formula = new RFormula().setFormula(value) val estimator = family match { @@ -38,11 +39,13 @@ private[r] object SparkRWrappers { .setRegParam(lambda) .setElasticNetParam(alpha) .setFitIntercept(formula.hasIntercept) + .setStandardization(standardize) .setSolver(solver) case "binomial" => new LogisticRegression() .setRegParam(lambda) .setElasticNetParam(alpha) .setFitIntercept(formula.hasIntercept) + .setStandardization(standardize) } val pipeline = new Pipeline().setStages(Array(formula, estimator)) pipeline.fit(df) |