spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject spark git commit: [MINOR] [DOC] fix mllib pydoc warnings
Date Thu, 13 Aug 2015 17:17:01 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.5 2b1353249 -> 883c7d35f


[MINOR] [DOC] fix mllib pydoc warnings

Switch to correct Sphinx syntax. MechCoder

Author: Xiangrui Meng <meng@databricks.com>

Closes #8169 from mengxr/mllib-pydoc-fix.

(cherry picked from commit 65fec798ce52ca6b8b0fe14b78a16712778ad04c)
Signed-off-by: Xiangrui Meng <meng@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/883c7d35
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/883c7d35
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/883c7d35

Branch: refs/heads/branch-1.5
Commit: 883c7d35f978a7d8651aaf8e93bd0c9ba09a441d
Parents: 2b13532
Author: Xiangrui Meng <meng@databricks.com>
Authored: Thu Aug 13 10:16:40 2015 -0700
Committer: Xiangrui Meng <meng@databricks.com>
Committed: Thu Aug 13 10:16:53 2015 -0700

----------------------------------------------------------------------
 python/pyspark/mllib/regression.py | 14 ++++++++++----
 python/pyspark/mllib/util.py       |  1 +
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/883c7d35/python/pyspark/mllib/regression.py
----------------------------------------------------------------------
diff --git a/python/pyspark/mllib/regression.py b/python/pyspark/mllib/regression.py
index 5b7afc1..41946e3 100644
--- a/python/pyspark/mllib/regression.py
+++ b/python/pyspark/mllib/regression.py
@@ -207,8 +207,10 @@ class LinearRegressionWithSGD(object):
         Train a linear regression model using Stochastic Gradient
         Descent (SGD).
         This solves the least squares regression formulation
-                f(weights) = 1/n ||A weights-y||^2^
-        (which is the mean squared error).
+
+            f(weights) = 1/(2n) ||A weights - y||^2,
+
+        which is the mean squared error.
         Here the data matrix has n rows, and the input RDD holds the
         set of rows of A, each with its corresponding right hand side
         label y. See also the documentation for the precise formulation.
@@ -334,7 +336,9 @@ class LassoWithSGD(object):
         Stochastic Gradient Descent.
         This solves the l1-regularized least squares regression
         formulation
-            f(weights) = 1/2n ||A weights-y||^2^  + regParam ||weights||_1
+
+            f(weights) = 1/(2n) ||A weights - y||^2  + regParam ||weights||_1.
+
         Here the data matrix has n rows, and the input RDD holds the
         set of rows of A, each with its corresponding right hand side
         label y. See also the documentation for the precise formulation.
@@ -451,7 +455,9 @@ class RidgeRegressionWithSGD(object):
         Stochastic Gradient Descent.
         This solves the l2-regularized least squares regression
         formulation
-            f(weights) = 1/2n ||A weights-y||^2^  + regParam/2 ||weights||^2^
+
+            f(weights) = 1/(2n) ||A weights - y||^2 + regParam/2 ||weights||^2.
+
         Here the data matrix has n rows, and the input RDD holds the
         set of rows of A, each with its corresponding right hand side
         label y. See also the documentation for the precise formulation.

http://git-wip-us.apache.org/repos/asf/spark/blob/883c7d35/python/pyspark/mllib/util.py
----------------------------------------------------------------------
diff --git a/python/pyspark/mllib/util.py b/python/pyspark/mllib/util.py
index 916de2d..10a1e4b 100644
--- a/python/pyspark/mllib/util.py
+++ b/python/pyspark/mllib/util.py
@@ -300,6 +300,7 @@ class LinearDataGenerator(object):
         :param: seed      Random Seed
         :param: eps       Used to scale the noise. If eps is set high,
                           the amount of gaussian noise added is more.
+
         Returns a list of LabeledPoints of length nPoints
         """
         weights = [float(weight) for weight in weights]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message