You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2020/07/16 13:25:36 UTC

[GitHub] [systemds] Shafaq-Siddiqi commented on a change in pull request #976: [SYSTEMDS-200] Gaussian Mixture Model builtin

Shafaq-Siddiqi commented on a change in pull request #976:
URL: https://github.com/apache/systemds/pull/976#discussion_r455783372



##########
File path: src/test/java/org/apache/sysds/test/functions/builtin/BuiltinGMMTest.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sysds.test.functions.builtin;
+
+import org.apache.sysds.common.Types;
+import org.apache.sysds.hops.OptimizerUtils;
+import org.apache.sysds.lops.LopProperties;
+import org.apache.sysds.runtime.matrix.data.MatrixValue;
+import org.apache.sysds.test.AutomatedTestBase;
+import org.apache.sysds.test.TestConfiguration;
+import org.apache.sysds.test.TestUtils;
+import org.junit.Test;
+
+import java.util.HashMap;
+
+public class BuiltinGMMTest extends AutomatedTestBase {
+	private final static String TEST_NAME = "GMM";
+	private final static String TEST_DIR = "functions/builtin/";
+	private static final String TEST_CLASS_DIR = TEST_DIR + BuiltinGMMTest.class.getSimpleName() + "/";
+
+	private final static double eps = 1;
+	private final static double tol = 1e-3;
+	private final static int rows = 100;
+	private final static double spDense = 0.99;
+	private final static String DATASET = SCRIPT_DIR + "functions/transform/input/iris/iris.csv";
+
+	@Override public void setUp() {
+		addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new String[] {"B"}));
+	}
+
+	@Test public void testGMMM1() { runGMMTest(3, "VVV", "random", 100, 0.000001, true, LopProperties.ExecType.CP); }
+
+	@Test public void testGMMM2() {
+		runGMMTest(3, "EEE", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM3() {
+		runGMMTest(3, "VVI", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM4() {
+		runGMMTest(3, "VII", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM1Kmean() {
+		runGMMTest(3, "VVV", "kmeans", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM2Kmean() {
+		runGMMTest(3, "EEE", "kmeans", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM3Kmean() {
+		runGMMTest(3, "VVI", "kmeans", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM4Kmean() {
+		runGMMTest(3, "VII", "kmeans", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM1Spark() { runGMMTest(3, "VVV", "random", 100, 0.000001, true, LopProperties.ExecType.SPARK); }
+
+	@Test public void testGMMM2Spark() {
+		runGMMTest(3, "EEE", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMMS3Spark() {
+		runGMMTest(3, "VVI", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM4Spark() {
+		runGMMTest(3, "VII", "random", 100, 0.000001, true, LopProperties.ExecType.CP);
+	}
+
+	@Test public void testGMMM1KmeanSpark() {
+		runGMMTest(3, "VVV", "kmeans", 100, 0.000001, false, LopProperties.ExecType.SPARK);
+	}
+
+	@Test public void testGMMM2KmeanSpark() {
+		runGMMTest(3, "EEE", "kmeans", 100, 0.000001, false, LopProperties.ExecType.SPARK);
+	}
+
+	@Test public void testGMMM3KmeanSpark() {
+		runGMMTest(3, "VVI", "kmeans", 100, 0.000001, false, LopProperties.ExecType.SPARK);
+	}
+
+	@Test public void testGMMM4KmeanSpark() {
+		runGMMTest(3, "VII", "kmeans", 100, 0.000001, false, LopProperties.ExecType.SPARK);

Review comment:
       Yes, We can switch them. I will push a commit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org