aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/logistic_regression.py
diff options
context:
space:
mode:
authorZheng RuiFeng <ruifengz@foxmail.com>2016-05-19 23:26:11 -0700
committerXiangrui Meng <meng@databricks.com>2016-05-19 23:26:11 -0700
commit47a2940da97caa55bbb8bb8ec1d51c9f6d5041c6 (patch)
tree2cad1dcab525990a7b18e6800634e45edcc36197 /examples/src/main/python/logistic_regression.py
parent4c7a6b385c79f4de07a89495afce4f8e73b06086 (diff)
downloadspark-47a2940da97caa55bbb8bb8ec1d51c9f6d5041c6.tar.gz
spark-47a2940da97caa55bbb8bb8ec1d51c9f6d5041c6.tar.bz2
spark-47a2940da97caa55bbb8bb8ec1d51c9f6d5041c6.zip
[SPARK-15398][ML] Update the warning message to recommend ML usage
## What changes were proposed in this pull request? MLlib are not recommended to use, and some methods are even deprecated. Update the warning message to recommend ML usage. ``` def showWarning() { System.err.println( """WARN: This is a naive implementation of Logistic Regression and is given as an example! |Please use either org.apache.spark.mllib.classification.LogisticRegressionWithSGD or |org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS |for more conventional use. """.stripMargin) } ``` To ``` def showWarning() { System.err.println( """WARN: This is a naive implementation of Logistic Regression and is given as an example! |Please use org.apache.spark.ml.classification.LogisticRegression |for more conventional use. """.stripMargin) } ``` ## How was this patch tested? local build Author: Zheng RuiFeng <ruifengz@foxmail.com> Closes #13190 from zhengruifeng/update_recd.
Diffstat (limited to 'examples/src/main/python/logistic_regression.py')
-rwxr-xr-xexamples/src/main/python/logistic_regression.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/src/main/python/logistic_regression.py b/examples/src/main/python/logistic_regression.py
index b318b7d87b..7d33be7e81 100755
--- a/examples/src/main/python/logistic_regression.py
+++ b/examples/src/main/python/logistic_regression.py
@@ -20,7 +20,7 @@ A logistic regression implementation that uses NumPy (http://www.numpy.org)
to act on batches of input data using efficient matrix operations.
In practice, one may prefer to use the LogisticRegression algorithm in
-MLlib, as shown in examples/src/main/python/mllib/logistic_regression.py.
+ML, as shown in examples/src/main/python/ml/logistic_regression_with_elastic_net.py.
"""
from __future__ import print_function
@@ -51,8 +51,9 @@ if __name__ == "__main__":
exit(-1)
print("""WARN: This is a naive implementation of Logistic Regression and is
- given as an example! Please refer to examples/src/main/python/mllib/logistic_regression.py
- to see how MLlib's implementation is used.""", file=sys.stderr)
+ given as an example!
+ Please refer to examples/src/main/python/ml/logistic_regression_with_elastic_net.py
+ to see how ML's implementation is used.""", file=sys.stderr)
sc = SparkContext(appName="PythonLR")
points = sc.textFile(sys.argv[1]).mapPartitions(readPointBatch).cache()