Repository: spark Updated Branches: refs/heads/master 9d376ad76 -> 97d461b75
[SPARK-17095] [Documentation] [Latex and Scala doc do not play nicely] ## What changes were proposed in this pull request? In Latex, it is common to find "}}}" when closing several expressions at once. [SPARK-16822](https://issues.apache.org/jira/browse/SPARK-16822) added Mathjax to render Latex equations in scaladoc. However, when scala doc sees "}}}" or "{{{" it treats it as a special character for code block. This results in some very strange output. Author: Jagadeesan <[email protected]> Closes #14688 from jagadeesanas2/SPARK-17095. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/97d461b7 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/97d461b7 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/97d461b7 Branch: refs/heads/master Commit: 97d461b75badbfa323d7f1508b20600ea189bb95 Parents: 9d376ad Author: Jagadeesan <[email protected]> Authored: Tue Aug 23 12:23:30 2016 +0100 Committer: Sean Owen <[email protected]> Committed: Tue Aug 23 12:23:30 2016 +0100 ---------------------------------------------------------------------- .../apache/spark/ml/feature/PolynomialExpansion.scala | 8 +++++--- .../ml/regression/GeneralizedLinearRegression.scala | 8 +++++--- .../apache/spark/ml/regression/LinearRegression.scala | 9 ++++++--- .../apache/spark/mllib/clustering/StreamingKMeans.scala | 12 ++++++++---- 4 files changed, 24 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/97d461b7/mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala b/mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala index 6e872c1..25fb6be 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala @@ -76,9 +76,11 @@ class PolynomialExpansion @Since("1.4.0") (@Since("1.4.0") override val uid: Str * (n + d choose d) (including 1 and first-order values). For example, let f([a, b, c], 3) be the * function that expands [a, b, c] to their monomials of degree 3. We have the following recursion: * - * {{{ - * f([a, b, c], 3) = f([a, b], 3) ++ f([a, b], 2) * c ++ f([a, b], 1) * c^2 ++ [c^3] - * }}} + * <p><blockquote> + * $$ + * f([a, b, c], 3) &= f([a, b], 3) ++ f([a, b], 2) * c ++ f([a, b], 1) * c^2 ++ [c^3] + * $$ + * </blockquote></p> * * To handle sparsity, if c is zero, we can skip all monomials that contain it. We remember the * current index and increment it properly for sparse input. http://git-wip-us.apache.org/repos/asf/spark/blob/97d461b7/mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala index 1d4dfd1..02b27fb 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala @@ -196,9 +196,11 @@ class GeneralizedLinearRegression @Since("2.0.0") (@Since("2.0.0") override val /** * Sets the regularization parameter for L2 regularization. * The regularization term is - * {{{ - * 0.5 * regParam * L2norm(coefficients)^2 - * }}} + * <p><blockquote> + * $$ + * 0.5 * regParam * L2norm(coefficients)^2 + * $$ + * </blockquote></p> * Default is 0.0. * * @group setParam http://git-wip-us.apache.org/repos/asf/spark/blob/97d461b7/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala index b1bb9b9..7fddfd9 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala @@ -338,9 +338,12 @@ class LinearRegression @Since("1.3.0") (@Since("1.3.0") override val uid: String /* Note that in Linear Regression, the objective history (loss + regularization) returned from optimizer is computed in the scaled space given by the following formula. - {{{ - L = 1/2n||\sum_i w_i(x_i - \bar{x_i}) / \hat{x_i} - (y - \bar{y}) / \hat{y}||^2 + regTerms - }}} + <p><blockquote> + $$ + L &= 1/2n||\sum_i w_i(x_i - \bar{x_i}) / \hat{x_i} - (y - \bar{y}) / \hat{y}||^2 + + regTerms \\ + $$ + </blockquote></p> */ val arrayBuilder = mutable.ArrayBuilder.make[Double] var state: optimizer.State = null http://git-wip-us.apache.org/repos/asf/spark/blob/97d461b7/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala b/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala index 52bdccb..f20ab09 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala @@ -39,10 +39,14 @@ import org.apache.spark.util.random.XORShiftRandom * generalized to incorporate forgetfullness (i.e. decay). * The update rule (for each cluster) is: * - * {{{ - * c_t+1 = [(c_t * n_t * a) + (x_t * m_t)] / [n_t + m_t] - * n_t+t = n_t * a + m_t - * }}} + * <p><blockquote> + * $$ + * \begin{align} + * c_t+1 &= [(c_t * n_t * a) + (x_t * m_t)] / [n_t + m_t] \\ + * n_t+t &= n_t * a + m_t + * \end{align} + * $$ + * </blockquote></p> * * Where c_t is the previously estimated centroid for that cluster, * n_t is the number of points assigned to it thus far, x_t is the centroid --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
