hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1405343 - in /hama/trunk/ml/src: main/java/org/apache/hama/ml/regression/GradientDescentBSP.java test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java
Date Sat, 03 Nov 2012 14:15:09 GMT
Author: tommaso
Date: Sat Nov  3 14:15:08 2012
New Revision: 1405343

URL: http://svn.apache.org/viewvc?rev=1405343&view=rev
Log:
[HAMA-666] - adjusting logistic regression unit test

Modified:
    hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
    hama/trunk/ml/src/test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java?rev=1405343&r1=1405342&r2=1405343&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java Sat
Nov  3 14:15:08 2012
@@ -212,7 +212,7 @@ public class GradientDescentBSP extends 
     if (theta == null) {
       if (master) {
         int size = getXSize(peer);
-        theta = new DenseDoubleVector(size, peer.getConfiguration().getInt(INITIAL_THETA_VALUES,
10));
+        theta = new DenseDoubleVector(size, peer.getConfiguration().getInt(INITIAL_THETA_VALUES,
1));
         for (String peerName : peer.getAllPeerNames()) {
           peer.send(peerName, new VectorWritable(theta));
         }

Modified: hama/trunk/ml/src/test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java?rev=1405343&r1=1405342&r2=1405343&view=diff
==============================================================================
--- hama/trunk/ml/src/test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java
(original)
+++ hama/trunk/ml/src/test/java/org/apache/hama/ml/regression/LogisticRegressionModelTest.java
Sat Nov  3 14:15:08 2012
@@ -18,7 +18,7 @@ public class LogisticRegressionModelTest
     double y = 1;
     DoubleVector theta = new DenseDoubleVector(new double[]{1, 1, 1});
     Double cost = logisticRegressionModel.calculateCostForItem(x, y, 2, theta);
-    assertEquals("wrong cost calculation for logistic regression", Double.valueOf(16d), cost);
+    assertEquals("wrong cost calculation for logistic regression", Double.valueOf(6.17010948616701E-5),
cost);
   }
 
   @Test



Mime
View raw message