Author: srowen
Date: Tue Jun 7 07:41:10 2011
New Revision: 1132893
URL: http://svn.apache.org/viewvc?rev=1132893&view=rev
Log:
MAHOUT-690 reduce test input size to speed up test
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolver.java
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolver.java
URL:
http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolver.java?rev=1132893&r1=1132892&r2=1132893&view=diff
==============================================================================
---
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolver.java
(original)
+++
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolver.java
Tue Jun 7 07:41:10 2011
@@ -41,10 +41,10 @@ public final class TestDistributedLanczo
public void setup() throws Exception {
File symTestData = getTestTempDir("symTestData");
File asymTestData = getTestTempDir("asymTestData");
- symCorpus = new TestDistributedRowMatrix().randomDistributedMatrix(500,
- 450, 400, 10, 10.0, true, symTestData.getAbsolutePath());
- asymCorpus = new TestDistributedRowMatrix().randomDistributedMatrix(500,
- 450, 400, 10, 10.0, false, asymTestData.getAbsolutePath());
+ symCorpus = new TestDistributedRowMatrix().randomDistributedMatrix(100,
+ 90, 80, 2, 10.0, true, symTestData.getAbsolutePath());
+ asymCorpus = new TestDistributedRowMatrix().randomDistributedMatrix(100,
+ 90, 80, 2, 10.0, false, asymTestData.getAbsolutePath());
}
private static String suf(boolean symmetric) {
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java
URL:
http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java?rev=1132893&r1=1132892&r2=1132893&view=diff
==============================================================================
---
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java
(original)
+++
mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java
Tue Jun 7 07:41:10 2011
@@ -43,7 +43,7 @@ public final class TestDistributedLanczo
public void testDistributedLanczosSolverCLI() throws Exception {
Path testData = getTestTempDirPath("testdata");
DistributedRowMatrix corpus =
- new
TestDistributedRowMatrix().randomDenseHierarchicalDistributedMatrix(50, 45,
false,
+ new
TestDistributedRowMatrix().randomDenseHierarchicalDistributedMatrix(10, 9,
false,
testData.toString());
corpus.setConf(new Configuration());
Path output = getTestTempDirPath("output");
@@ -53,9 +53,9 @@ public final class TestDistributedLanczo
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
- "--numRows", "50",
- "--numCols", "45",
- "--rank", "30",
+ "--numRows", "10",
+ "--numCols", "9",
+ "--rank", "6",
"--symmetric", "false",
"--workingDir", workingDir.toString()
};
@@ -67,16 +67,16 @@ public final class TestDistributedLanczo
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
- "--numRows", "50",
- "--numCols", "45",
- "--rank", "35",
+ "--numRows", "10",
+ "--numCols", "9",
+ "--rank", "7",
"--symmetric", "false",
"--workingDir", workingDir.toString()
};
new DistributedLanczosSolver().new DistributedLanczosSolverJob().run(args);
Path rawEigenvectors = new Path(output,
DistributedLanczosSolver.RAW_EIGENVECTORS);
- Matrix eigenVectors = new DenseMatrix(35, corpus.numCols());
+ Matrix eigenVectors = new DenseMatrix(7, corpus.numCols());
Configuration conf = new Configuration();
int i = 0;
@@ -85,14 +85,14 @@ public final class TestDistributedLanczo
eigenVectors.assignRow(i, v);
i++;
}
- assertEquals("number of eigenvectors", 35, i);
+ assertEquals("number of eigenvectors", 7, i);
}
@Test
public void testDistributedLanczosSolverEVJCLI() throws Exception {
Path testData = getTestTempDirPath("testdata");
DistributedRowMatrix corpus = new TestDistributedRowMatrix()
- .randomDenseHierarchicalDistributedMatrix(50, 45, false,
testData.toString());
+ .randomDenseHierarchicalDistributedMatrix(10, 9, false,
testData.toString());
corpus.setConf(new Configuration());
Path output = getTestTempDirPath("output");
Path tmp = getTestTempDirPath("tmp");
@@ -100,16 +100,16 @@ public final class TestDistributedLanczo
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
- "--numRows", "50",
- "--numCols", "45",
- "--rank", "30",
+ "--numRows", "10",
+ "--numCols", "9",
+ "--rank", "6",
"--symmetric", "false",
"--cleansvd", "true"
};
new DistributedLanczosSolver().new DistributedLanczosSolverJob().run(args);
Path cleanEigenvectors = new Path(output,
EigenVerificationJob.CLEAN_EIGENVECTORS);
- Matrix eigenVectors = new DenseMatrix(30, corpus.numCols());
+ Matrix eigenVectors = new DenseMatrix(6, corpus.numCols());
Collection<Double> eigenvalues = new ArrayList<Double>();
output = getTestTempDirPath("output2");
@@ -118,15 +118,15 @@ public final class TestDistributedLanczo
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
- "--numRows", "50",
- "--numCols", "45",
- "--rank", "35",
+ "--numRows", "10",
+ "--numCols", "9",
+ "--rank", "7",
"--symmetric", "false",
"--cleansvd", "true"
};
new DistributedLanczosSolver().new DistributedLanczosSolverJob().run(args);
Path cleanEigenvectors2 = new Path(output,
EigenVerificationJob.CLEAN_EIGENVECTORS);
- Matrix eigenVectors2 = new DenseMatrix(35, corpus.numCols());
+ Matrix eigenVectors2 = new DenseMatrix(7, corpus.numCols());
Configuration conf = new Configuration();
Collection<Double> newEigenValues = new ArrayList<Double>();
@@ -140,7 +140,7 @@ public final class TestDistributedLanczo
}
i++;
}
- assertEquals("number of clean eigenvectors", 23, i);
+ assertEquals("number of clean eigenvectors", 3, i);
i = 0;
for (VectorWritable value : new
SequenceFileValueIterable<VectorWritable>(cleanEigenvectors2, conf)) {
@@ -167,7 +167,7 @@ public final class TestDistributedLanczo
}
}
}
- assertEquals("the number of new eigenvectors", 30, i);
+ assertEquals("the number of new eigenvectors", 5, i);
Collection<Double> oldEigenValuesNotFound = new ArrayList<Double>();
for(double d : eigenvalues) {
@@ -184,7 +184,7 @@ public final class TestDistributedLanczo
assertEquals("number of old eigenvalues not found: "
+ Arrays.toString(oldEigenValuesNotFound.toArray(new
Double[oldEigenValuesNotFound.size()])),
0, oldEigenValuesNotFound.size());
- assertEquals("did not find enough old eigenvectors", 16,
oldEigensFound.size());
+ assertEquals("did not find enough old eigenvectors", 3,
oldEigensFound.size());
}
}