use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class TransformAndApplyTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration(TEST_NAME1, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] { "R1", "R2" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class TransformFrameApplyTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration(TEST_NAME1, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] { "y" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class TransformReadMetaTest method setUp.
@Override
public void setUp() {
TestUtils.clearAssertionInformation();
addTestConfiguration(TEST_NAME1, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] { "M1, M" }));
addTestConfiguration(TEST_NAME2, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2, new String[] { "M1, M" }));
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class BivariateCategoricalCategoricallTest method testOddsRatio.
@Test
public void testOddsRatio() {
TestConfiguration config = getTestConfiguration(TEST_ODDS_RATIO);
config.addVariable("rows", rows);
loadTestConfiguration(config);
/* This is for running the junit test the new way, i.e., construct the arguments directly */
String CC_HOME = SCRIPT_DIR + TEST_DIR;
fullDMLScriptName = CC_HOME + TEST_ODDS_RATIO + ".dml";
programArgs = new String[] { "-args", input("A"), Integer.toString(rows), input("B"), output("oddsRatio"), output("sigma"), output("leftConf"), output("rightConf"), output("sigmasAway") // output("chiSquared"),
// output(degFreedom"),
// output("pValue"),
// output("cramersV")
};
fullRScriptName = CC_HOME + TEST_ODDS_RATIO + ".R";
rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
// current test works only for 2x2 contingency tables => #categories must be 2
int numCat = 2;
double[][] A = getRandomMatrix(rows, 1, 1, numCat, 1, System.currentTimeMillis());
double[][] B = getRandomMatrix(rows, 1, 1, numCat, 1, System.currentTimeMillis() + 1);
TestUtils.round(A);
TestUtils.round(B);
writeInputMatrix("A", A, true);
writeInputMatrix("B", B, true);
runTest(true, false, null, -1);
runRScript(true);
for (String file : config.getOutputFiles()) {
/* NOte that some files do not contain matrix, but just a single scalar value inside */
HashMap<CellIndex, Double> dmlfile;
HashMap<CellIndex, Double> rfile;
if (file.endsWith(".scalar")) {
file = file.replace(".scalar", "");
dmlfile = readDMLScalarFromHDFS(file);
rfile = readRScalarFromFS(file);
} else {
dmlfile = readDMLMatrixFromHDFS(file);
rfile = readRMatrixFromFS(file);
}
TestUtils.compareMatrices(dmlfile, rfile, eps, file + "-DML", file + "-R");
}
}
use of org.apache.sysml.test.integration.TestConfiguration in project incubator-systemml by apache.
the class BivariateOrdinalOrdinalTest method testOrdinalOrdinalWithWeights.
@Test
public void testOrdinalOrdinalWithWeights() {
TestConfiguration config = getTestConfiguration(TEST_ORDINAL_ORDINAL_WEIGHTS);
config.addVariable("rows", rows);
loadTestConfiguration(config);
/* This is for running the junit test the new way, i.e., construct the arguments directly */
String OO_HOME = SCRIPT_DIR + TEST_DIR;
fullDMLScriptName = OO_HOME + TEST_ORDINAL_ORDINAL_WEIGHTS + ".dml";
programArgs = new String[] { "-args", input("A"), Integer.toString(rows), input("B"), input("WM"), output("Spearman") };
fullRScriptName = OO_HOME + TEST_ORDINAL_ORDINAL_WEIGHTS + ".R";
rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
double[][] A = getRandomMatrix(rows, 1, 1, ncatA, 1, System.currentTimeMillis());
double[][] B = getRandomMatrix(rows, 1, 1, ncatB, 1, System.currentTimeMillis());
double[][] WM = getRandomMatrix(rows, 1, 1, maxW, 1, System.currentTimeMillis());
TestUtils.floor(A);
TestUtils.floor(B);
TestUtils.floor(WM);
writeInputMatrix("A", A, true);
writeInputMatrix("B", B, true);
writeInputMatrix("WM", WM, true);
runTest(true, false, null, -1);
runRScript(true);
for (String file : config.getOutputFiles()) {
/* NOte that some files do not contain matrix, but just a single scalar value inside */
HashMap<CellIndex, Double> dmlfile;
HashMap<CellIndex, Double> rfile;
if (file.endsWith(".scalar")) {
file = file.replace(".scalar", "");
dmlfile = readDMLScalarFromHDFS(file);
rfile = readRScalarFromFS(file);
} else {
dmlfile = readDMLMatrixFromHDFS(file);
rfile = readRMatrixFromFS(file);
}
TestUtils.compareMatrices(dmlfile, rfile, eps, file + "-DML", file + "-R");
}
}
Aggregations