aboutsummaryrefslogtreecommitdiff
path: root/mllib/src
diff options
context:
space:
mode:
authorZheng RuiFeng <ruifengz@foxmail.com>2016-04-28 22:44:14 -0700
committerJoseph K. Bradley <joseph@databricks.com>2016-04-28 22:44:14 -0700
commitcabd54d93162a3f2a0cc7ed76fb46d8224edab94 (patch)
treeea9fd0548780ced8b3db432a068d8c7c809a4568 /mllib/src
parent769a909d1357766a441ff69e6e98c22c51b12c93 (diff)
downloadspark-cabd54d93162a3f2a0cc7ed76fb46d8224edab94.tar.gz
spark-cabd54d93162a3f2a0cc7ed76fb46d8224edab94.tar.bz2
spark-cabd54d93162a3f2a0cc7ed76fb46d8224edab94.zip
[SPARK-14829][MLLIB] Deprecate GLM APIs using SGD
## What changes were proposed in this pull request? According to the [SPARK-14829](https://issues.apache.org/jira/browse/SPARK-14829), deprecate API of LogisticRegression and LinearRegression using SGD ## How was this patch tested? manual tests Author: Zheng RuiFeng <ruifengz@foxmail.com> Closes #12596 from zhengruifeng/deprecate_sgd.
Diffstat (limited to 'mllib/src')
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala2
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala4
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala2
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala4
4 files changed, 12 insertions, 0 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
index f10570e662..1d25a58e0f 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
@@ -206,6 +206,7 @@ object LogisticRegressionModel extends Loader[LogisticRegressionModel] {
* Using [[LogisticRegressionWithLBFGS]] is recommended over this.
*/
@Since("0.8.0")
+@deprecated("Use ml.classification.LogisticRegression or LogisticRegressionWithLBFGS", "2.0.0")
class LogisticRegressionWithSGD private[mllib] (
private var stepSize: Double,
private var numIterations: Int,
@@ -240,6 +241,7 @@ class LogisticRegressionWithSGD private[mllib] (
* NOTE: Labels used in Logistic Regression should be {0, 1}
*/
@Since("0.8.0")
+@deprecated("Use ml.classification.LogisticRegression or LogisticRegressionWithLBFGS", "2.0.0")
object LogisticRegressionWithSGD {
// NOTE(shivaram): We use multiple train methods instead of default arguments to support
// Java programs.
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala b/mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala
index d55e5dfdaa..ef8c80f0cb 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala
@@ -85,6 +85,8 @@ object LassoModel extends Loader[LassoModel] {
* See also the documentation for the precise formulation.
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression with elasticNetParam = 1.0. Note the default " +
+ "regParam is 0.01 for LassoWithSGD, but is 0.0 for LinearRegression.", "2.0.0")
class LassoWithSGD private (
private var stepSize: Double,
private var numIterations: Int,
@@ -118,6 +120,8 @@ class LassoWithSGD private (
*
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression with elasticNetParam = 1.0. Note the default " +
+ "regParam is 0.01 for LassoWithSGD, but is 0.0 for LinearRegression.", "2.0.0")
object LassoWithSGD {
/**
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala
index e754e74492..9e9d98bc5e 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala
@@ -86,6 +86,7 @@ object LinearRegressionModel extends Loader[LinearRegressionModel] {
* See also the documentation for the precise formulation.
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression or LBFGS", "2.0.0")
class LinearRegressionWithSGD private[mllib] (
private var stepSize: Double,
private var numIterations: Int,
@@ -119,6 +120,7 @@ class LinearRegressionWithSGD private[mllib] (
*
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression or LBFGS", "2.0.0")
object LinearRegressionWithSGD {
/**
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala
index 0a44ff559d..512fb9a712 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala
@@ -86,6 +86,8 @@ object RidgeRegressionModel extends Loader[RidgeRegressionModel] {
* See also the documentation for the precise formulation.
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression with elasticNetParam = 0.0. Note the default " +
+ "regParam is 0.01 for RidgeRegressionWithSGD, but is 0.0 for LinearRegression.", "2.0.0")
class RidgeRegressionWithSGD private (
private var stepSize: Double,
private var numIterations: Int,
@@ -119,6 +121,8 @@ class RidgeRegressionWithSGD private (
*
*/
@Since("0.8.0")
+@deprecated("Use ml.regression.LinearRegression with elasticNetParam = 0.0. Note the default " +
+ "regParam is 0.01 for RidgeRegressionWithSGD, but is 0.0 for LinearRegression.", "2.0.0")
object RidgeRegressionWithSGD {
/**