spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject spark git commit: [SPARK-21210][DOC][ML] Javadoc 8 fixes for ML shared param traits
Date Thu, 29 Jun 2017 08:51:24 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-2.2 970f68c05 -> 17a04b900


[SPARK-21210][DOC][ML] Javadoc 8 fixes for ML shared param traits

PR #15999 included fixes for doc strings in the ML shared param traits (occurrences of `>`
and `>=`).

This PR simply uses the HTML-escaped version of the param doc to embed into the Scaladoc,
to ensure that when `SharedParamsCodeGen` is run, the generated javadoc will be compliant
for Java 8.

## How was this patch tested?
Existing tests

Author: Nick Pentreath <nickp@za.ibm.com>

Closes #18420 from MLnick/shared-params-javadoc8.

(cherry picked from commit 70085e83d1ee728b23f7df15f570eb8d77f67a7a)
Signed-off-by: Sean Owen <sowen@cloudera.com>


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

Branch: refs/heads/branch-2.2
Commit: 17a04b9000f86c04f492927d4aa3b23d60e2b5b6
Parents: 970f68c
Author: Nick Pentreath <nickp@za.ibm.com>
Authored: Thu Jun 29 09:51:12 2017 +0100
Committer: Sean Owen <sowen@cloudera.com>
Committed: Thu Jun 29 09:51:21 2017 +0100

----------------------------------------------------------------------
 .../org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala  | 5 ++++-
 .../scala/org/apache/spark/ml/param/shared/sharedParams.scala   | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/17a04b90/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala
b/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala
index c94b8b4..013817a 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala
@@ -20,6 +20,7 @@ package org.apache.spark.ml.param.shared
 import java.io.PrintWriter
 
 import scala.reflect.ClassTag
+import scala.xml.Utility
 
 /**
  * Code generator for shared params (sharedParams.scala). Run under the Spark folder with
@@ -167,6 +168,8 @@ private[shared] object SharedParamsCodeGen {
       "def"
     }
 
+    val htmlCompliantDoc = Utility.escape(doc)
+
     s"""
       |/**
       | * Trait for shared param $name$defaultValueDoc.
@@ -174,7 +177,7 @@ private[shared] object SharedParamsCodeGen {
       |private[ml] trait Has$Name extends Params {
       |
       |  /**
-      |   * Param for $doc.
+      |   * Param for $htmlCompliantDoc.
       |   * @group ${groupStr(0)}
       |   */
       |  final val $name: $Param = new $Param(this, "$name", "$doc"$isValid)

http://git-wip-us.apache.org/repos/asf/spark/blob/17a04b90/mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala b/mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
index e3e03df..5061960 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
@@ -176,7 +176,7 @@ private[ml] trait HasThreshold extends Params {
 private[ml] trait HasThresholds extends Params {
 
   /**
-   * Param for Thresholds in multi-class classification to adjust the probability of predicting
each class. Array must have length equal to the number of classes, with values > 0 excepting
that at most one value may be 0. The class with largest value p/t is predicted, where p is
the original probability of that class and t is the class's threshold.
+   * Param for Thresholds in multi-class classification to adjust the probability of predicting
each class. Array must have length equal to the number of classes, with values &gt; 0
excepting that at most one value may be 0. The class with largest value p/t is predicted,
where p is the original probability of that class and t is the class's threshold.
    * @group param
    */
   final val thresholds: DoubleArrayParam = new DoubleArrayParam(this, "thresholds", "Thresholds
in multi-class classification to adjust the probability of predicting each class. Array must
have length equal to the number of classes, with values > 0 excepting that at most one
value may be 0. The class with largest value p/t is predicted, where p is the original probability
of that class and t is the class's threshold", (t: Array[Double]) => t.forall(_ >= 0)
&& t.count(_ == 0) <= 1)


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


Mime
View raw message