Repository: spark
Updated Branches:
  refs/heads/branch-1.1 3111501ea -> f41c45a75


[SPARK-3372] [MLlib] MLlib doesn't pass maven build / checkstyle due to 
multi-byte character contained in Gradient.scala

Author: Kousuke Saruta <saru...@oss.nttdata.co.jp>

Closes #2248 from sarutak/SPARK-3372 and squashes the following commits:

73a28b8 [Kousuke Saruta] Replaced UTF-8 hyphen with ascii hyphen

(cherry picked from commit 1bed0a3869a526241381d2a74ba064e5b3721336)
Signed-off-by: Xiangrui Meng <m...@databricks.com>


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

Branch: refs/heads/branch-1.1
Commit: f41c45a75681e47f0840d4a33c1a5a760e9f1daf
Parents: 3111501
Author: Kousuke Saruta <saru...@oss.nttdata.co.jp>
Authored: Wed Sep 3 20:47:00 2014 -0700
Committer: Xiangrui Meng <m...@databricks.com>
Committed: Wed Sep 3 20:47:14 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/mllib/optimization/Gradient.scala     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/f41c45a7/mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala 
b/mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala
index fdd6716..45dbf60 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala
@@ -128,7 +128,7 @@ class LeastSquaresGradient extends Gradient {
 class HingeGradient extends Gradient {
   override def compute(data: Vector, label: Double, weights: Vector): (Vector, 
Double) = {
     val dotProduct = dot(data, weights)
-    // Our loss function with {0, 1} labels is max(0, 1 - (2y – 1) (f_w(x)))
+    // Our loss function with {0, 1} labels is max(0, 1 - (2y - 1) (f_w(x)))
     // Therefore the gradient is -(2y - 1)*x
     val labelScaled = 2 * label - 1.0
     if (1.0 > labelScaled * dotProduct) {
@@ -146,7 +146,7 @@ class HingeGradient extends Gradient {
       weights: Vector,
       cumGradient: Vector): Double = {
     val dotProduct = dot(data, weights)
-    // Our loss function with {0, 1} labels is max(0, 1 - (2y – 1) (f_w(x)))
+    // Our loss function with {0, 1} labels is max(0, 1 - (2y - 1) (f_w(x)))
     // Therefore the gradient is -(2y - 1)*x
     val labelScaled = 2 * label - 1.0
     if (1.0 > labelScaled * dotProduct) {


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

Reply via email to