use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class ReadCSVTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new String[] { "Rout" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class WriteCSVTest method runCSVWriteTest.
private void runCSVWriteTest(RUNTIME_PLATFORM platform, boolean header, String sep, boolean sparse) throws IOException {
RUNTIME_PLATFORM oldPlatform = rtplatform;
rtplatform = platform;
TestConfiguration config = getTestConfiguration(TEST_NAME);
loadTestConfiguration(config);
String HOME = SCRIPT_DIR + TEST_DIR;
// always read the same data, independent of testNumber
String inputMatrixName = HOME + INPUT_DIR + "transfusion_1";
String dmlOutput = output("dml.scalar");
String csvOutputName = output("transfusion_dml.data");
String rOutput = output("R.scalar");
fullDMLScriptName = HOME + TEST_NAME + ".dml";
programArgs = new String[] { "-explain", "-args", inputMatrixName, dmlOutput, csvOutputName, Boolean.toString(header), sep, Boolean.toString(sparse) };
runTest(true, false, null, -1);
// Verify produced CSV file w/ R
csvOutputName = TestUtils.processMultiPartCSVForR(csvOutputName);
fullRScriptName = HOME + "writecsv_verify.R";
rCmd = "Rscript" + " " + fullRScriptName + " " + csvOutputName + " " + Boolean.toString(header).toUpperCase() + " " + sep + " " + rOutput;
runRScript(true);
double dmlScalar = TestUtils.readDMLScalar(dmlOutput);
double rScalar = TestUtils.readRScalar(rOutput);
TestUtils.compareScalars(dmlScalar, rScalar, eps);
rtplatform = oldPlatform;
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class FrameEncodeTest method runJMLCReuseTest.
private void runJMLCReuseTest(String testname, boolean sparse, boolean modelReuse) throws IOException {
String TEST_NAME = testname;
TestConfiguration config = getTestConfiguration(TEST_NAME);
loadTestConfiguration(config);
// generate inputs
double[][] Fd = TestUtils.round(getRandomMatrix(rows, cols, 0.51, 7.49, sparse ? sparsity2 : sparsity1, 1234));
String[][] F1s = FrameTransformTest.createFrameData(Fd);
// run DML via JMLC
ArrayList<String[][]> F2set = execDMLScriptviaJMLC(TEST_NAME, F1s, modelReuse);
// check correct result
for (String[][] data : F2set) for (int i = 0; i < F1s.length; i++) for (int j = 0; j < F1s[i].length; j++) Assert.assertEquals("Wrong result: " + data[i][j] + ".", data[i][j], F1s[i][j]);
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class FrameIndexingAppendTest method runJMLCReuseTest.
private void runJMLCReuseTest(String testname, boolean sparse, boolean modelReuse) throws IOException {
String TEST_NAME = testname;
TestConfiguration config = getTestConfiguration(TEST_NAME);
loadTestConfiguration(config);
// generate inputs
double[][] Fd = TestUtils.round(getRandomMatrix(rows, cols, 0.51, 7.49, sparse ? sparsity2 : sparsity1, 1234));
String[][] F1s = FrameTransformTest.createFrameData(Fd);
String[][] Ms = FrameTransformTest.createRecodeMaps(F1s);
// run DML via JMLC
ArrayList<String[][]> F2set = execDMLScriptviaJMLC(TEST_NAME, F1s, Ms, modelReuse);
// check correct result
for (String[][] data : F2set) for (int i = 0; i < F1s.length; i++) for (int j = 0; j < F1s[i].length; j++) Assert.assertEquals("Wrong result: " + data[i][j] + ".", data[i][j], F1s[i][j]);
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class FrameLeftIndexingTest method runJMLCReuseTest.
private void runJMLCReuseTest(String testname, boolean sparse, boolean modelReuse) throws IOException {
String TEST_NAME = testname;
TestConfiguration config = getTestConfiguration(TEST_NAME);
loadTestConfiguration(config);
// generate inputs
double[][] Fd = TestUtils.round(getRandomMatrix(rows, cols, 0.51, 7.49, sparse ? sparsity2 : sparsity1, 1234));
String[][] F1s = FrameTransformTest.createFrameData(Fd);
String[][] Ms = FrameTransformTest.createRecodeMaps(F1s);
// run DML via JMLC
ArrayList<String[][]> F2set = execDMLScriptviaJMLC(TEST_NAME, F1s, Ms, modelReuse);
// check correct result
for (String[][] data : F2set) for (int i = 0; i < F1s.length; i++) for (int j = 0; j < F1s[i].length; j++) Assert.assertEquals("Wrong result: " + data[i][j] + ".", data[i][j], F1s[i][j]);
}
Aggregations