aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/regression.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark/mllib/regression.py')
-rw-r--r--python/pyspark/mllib/regression.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/pyspark/mllib/regression.py b/python/pyspark/mllib/regression.py
index 3b77a62000..639c5eabaa 100644
--- a/python/pyspark/mllib/regression.py
+++ b/python/pyspark/mllib/regression.py
@@ -17,6 +17,7 @@
import numpy as np
from numpy import array
+import warnings
from pyspark import RDD, since
from pyspark.streaming.dstream import DStream
@@ -221,6 +222,7 @@ def _regression_train_wrapper(train_func, modelClass, data, initial_weights):
class LinearRegressionWithSGD(object):
"""
.. versionadded:: 0.9.0
+ .. note:: Deprecated in 2.0.0. Use ml.regression.LinearRegression.
"""
@classmethod
@since("0.9.0")
@@ -276,6 +278,8 @@ class LinearRegressionWithSGD(object):
A condition which decides iteration termination.
(default: 0.001)
"""
+ warnings.warn("Deprecated in 2.0.0. Use ml.regression.LinearRegression.")
+
def train(rdd, i):
return callMLlibFunc("trainLinearRegressionModelWithSGD", rdd, int(iterations),
float(step), float(miniBatchFraction), i, float(regParam),
@@ -366,6 +370,8 @@ class LassoModel(LinearRegressionModelBase):
class LassoWithSGD(object):
"""
.. versionadded:: 0.9.0
+ .. note:: Deprecated in 2.0.0. Use ml.regression.LinearRegression with elasticNetParam = 1.0.
+ Note the default regParam is 0.01 for LassoWithSGD, but is 0.0 for LinearRegression.
"""
@classmethod
@since("0.9.0")
@@ -413,6 +419,10 @@ class LassoWithSGD(object):
A condition which decides iteration termination.
(default: 0.001)
"""
+ warnings.warn(
+ "Deprecated in 2.0.0. Use ml.regression.LinearRegression with elasticNetParam = 1.0. "
+ "Note the default regParam is 0.01 for LassoWithSGD, but is 0.0 for LinearRegression.")
+
def train(rdd, i):
return callMLlibFunc("trainLassoModelWithSGD", rdd, int(iterations), float(step),
float(regParam), float(miniBatchFraction), i, bool(intercept),
@@ -503,6 +513,9 @@ class RidgeRegressionModel(LinearRegressionModelBase):
class RidgeRegressionWithSGD(object):
"""
.. versionadded:: 0.9.0
+ .. note:: Deprecated in 2.0.0. Use ml.regression.LinearRegression with elasticNetParam = 0.0.
+ Note the default regParam is 0.01 for RidgeRegressionWithSGD, but is 0.0 for
+ LinearRegression.
"""
@classmethod
@since("0.9.0")
@@ -550,6 +563,11 @@ class RidgeRegressionWithSGD(object):
A condition which decides iteration termination.
(default: 0.001)
"""
+ warnings.warn(
+ "Deprecated in 2.0.0. Use ml.regression.LinearRegression with elasticNetParam = 0.0. "
+ "Note the default regParam is 0.01 for RidgeRegressionWithSGD, but is 0.0 for "
+ "LinearRegression.")
+
def train(rdd, i):
return callMLlibFunc("trainRidgeModelWithSGD", rdd, int(iterations), float(step),
float(regParam), float(miniBatchFraction), i, bool(intercept),