diff options
author | Ismael Juma <ismael@juma.me.uk> | 2011-05-26 22:06:36 +0100 |
---|---|---|
committer | Ismael Juma <ismael@juma.me.uk> | 2011-05-26 22:06:36 +0100 |
commit | 0b6a862b6846a08ee0de8c53d5c657d05798e74d (patch) | |
tree | fdf8c9473a35a29380b4b856b6f85c7fd2a8fdf0 /examples/src/main/scala | |
parent | 1f27d94c483b674a2076e6f420b85c323395eb86 (diff) | |
download | spark-0b6a862b6846a08ee0de8c53d5c657d05798e74d.tar.gz spark-0b6a862b6846a08ee0de8c53d5c657d05798e74d.tar.bz2 spark-0b6a862b6846a08ee0de8c53d5c657d05798e74d.zip |
Use math instead of Math as the latter is deprecated.
Diffstat (limited to 'examples/src/main/scala')
-rw-r--r-- | examples/src/main/scala/spark/examples/LocalFileLR.scala | 2 | ||||
-rw-r--r-- | examples/src/main/scala/spark/examples/LocalLR.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/src/main/scala/spark/examples/LocalFileLR.scala b/examples/src/main/scala/spark/examples/LocalFileLR.scala index cc14aa7090..2e94ccbec2 100644 --- a/examples/src/main/scala/spark/examples/LocalFileLR.scala +++ b/examples/src/main/scala/spark/examples/LocalFileLR.scala @@ -27,7 +27,7 @@ object LocalFileLR { println("On iteration " + i) var gradient = Vector.zeros(D) for (p <- points) { - val scale = (1 / (1 + Math.exp(-p.y * (w dot p.x))) - 1) * p.y + val scale = (1 / (1 + math.exp(-p.y * (w dot p.x))) - 1) * p.y gradient += scale * p.x } w -= gradient diff --git a/examples/src/main/scala/spark/examples/LocalLR.scala b/examples/src/main/scala/spark/examples/LocalLR.scala index 3fd3f88fa8..96cda80277 100644 --- a/examples/src/main/scala/spark/examples/LocalLR.scala +++ b/examples/src/main/scala/spark/examples/LocalLR.scala @@ -32,7 +32,7 @@ object LocalLR { println("On iteration " + i) var gradient = Vector.zeros(D) for (p <- data) { - val scale = (1 / (1 + Math.exp(-p.y * (w dot p.x))) - 1) * p.y + val scale = (1 / (1 + math.exp(-p.y * (w dot p.x))) - 1) * p.y gradient += scale * p.x } w -= gradient |