use of org.apache.sysml.api.mlcontext.MatrixMetadata in project systemml by apache.
the class MLContextTest method testJavaRDDGoodMetadataDML.
@Test
public void testJavaRDDGoodMetadataDML() {
System.out.println("MLContextTest - JavaRDD<String> good metadata DML");
List<String> list = new ArrayList<String>();
list.add("1,2,3");
list.add("4,5,6");
list.add("7,8,9");
JavaRDD<String> javaRDD = sc.parallelize(list);
MatrixMetadata mm = new MatrixMetadata(3, 3, 9);
Script script = dml("print('sum: ' + sum(M));").in("M", javaRDD, mm);
setExpectedStdOut("sum: 45.0");
ml.execute(script);
}
use of org.apache.sysml.api.mlcontext.MatrixMetadata in project systemml by apache.
the class MLContextTest method testIJVMatrixFromURLSumPYDML.
@Test
public void testIJVMatrixFromURLSumPYDML() throws MalformedURLException {
System.out.println("MLContextTest - IJV matrix from URL sum PYDML");
String ijv = "https://raw.githubusercontent.com/apache/systemml/master/src/test/scripts/org/apache/sysml/api/mlcontext/1234.ijv";
URL url = new URL(ijv);
MatrixMetadata mm = new MatrixMetadata(MatrixFormat.IJV, 2, 2);
Script script = pydml("print('sum: ' + sum(M))").in("M", url, mm);
setExpectedStdOut("sum: 10.0");
ml.execute(script);
}
Aggregations