You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by td...@apache.org on 2010/09/17 21:51:54 UTC
svn commit: r998291 -
/mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java
Author: tdunning
Date: Fri Sep 17 19:51:54 2010
New Revision: 998291
URL: http://svn.apache.org/viewvc?rev=998291&view=rev
Log:
Added flush to test, made ALR test learn shorter time
so additional improvement is discernible
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java
Modified: mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java?rev=998291&r1=998290&r2=998291&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java Fri Sep 17 19:51:54 2010
@@ -33,6 +33,7 @@ public final class TextValueEncoderTest
TextValueEncoder enc = new TextValueEncoder("text");
Vector v1 = new DenseVector(200);
enc.addToVector("test1 and more", v1);
+ enc.flush(1, v1);
// should set 6 distinct locations to 1
assertEquals(6.0, v1.norm(1), 0);
assertEquals(1.0, v1.maxValue(), 0);
@@ -45,13 +46,13 @@ public final class TextValueEncoderTest
// should set 6 locations to something
Vector v2 = new DenseVector(200);
enc.addToVector("test1 and more", v2);
+ enc.flush(1, v2);
// this should set the same 6 locations to the same values
Vector v3 = new DenseVector(200);
w.addToVector("test1", v3);
w.addToVector("and", v3);
w.addToVector("more", v3);
-
assertEquals(0, v3.minus(v2).norm(1), 0);
// moreover, the locations set in the unweighted case should be the same as in the weighted case