Skip to content
Snippets Groups Projects
Commit 65fec798 authored by Xiangrui Meng's avatar Xiangrui Meng
Browse files

[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.
parent 4b70798c
No related branches found
No related tags found
No related merge requests found
...@@ -207,8 +207,10 @@ class LinearRegressionWithSGD(object): ...@@ -207,8 +207,10 @@ class LinearRegressionWithSGD(object):
Train a linear regression model using Stochastic Gradient Train a linear regression model using Stochastic Gradient
Descent (SGD). Descent (SGD).
This solves the least squares regression formulation 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 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 set of rows of A, each with its corresponding right hand side
label y. See also the documentation for the precise formulation. label y. See also the documentation for the precise formulation.
...@@ -334,7 +336,9 @@ class LassoWithSGD(object): ...@@ -334,7 +336,9 @@ class LassoWithSGD(object):
Stochastic Gradient Descent. Stochastic Gradient Descent.
This solves the l1-regularized least squares regression This solves the l1-regularized least squares regression
formulation 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 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 set of rows of A, each with its corresponding right hand side
label y. See also the documentation for the precise formulation. label y. See also the documentation for the precise formulation.
...@@ -451,7 +455,9 @@ class RidgeRegressionWithSGD(object): ...@@ -451,7 +455,9 @@ class RidgeRegressionWithSGD(object):
Stochastic Gradient Descent. Stochastic Gradient Descent.
This solves the l2-regularized least squares regression This solves the l2-regularized least squares regression
formulation 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 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 set of rows of A, each with its corresponding right hand side
label y. See also the documentation for the precise formulation. label y. See also the documentation for the precise formulation.
......
...@@ -300,6 +300,7 @@ class LinearDataGenerator(object): ...@@ -300,6 +300,7 @@ class LinearDataGenerator(object):
:param: seed Random Seed :param: seed Random Seed
:param: eps Used to scale the noise. If eps is set high, :param: eps Used to scale the noise. If eps is set high,
the amount of gaussian noise added is more. the amount of gaussian noise added is more.
Returns a list of LabeledPoints of length nPoints Returns a list of LabeledPoints of length nPoints
""" """
weights = [float(weight) for weight in weights] weights = [float(weight) for weight in weights]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment