systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [systemml] deutschmn commented on a change in pull request #916: Add to_one_hot builtin function
Date Wed, 20 May 2020 09:51:06 GMT

deutschmn commented on a change in pull request #916:
URL: https://github.com/apache/systemml/pull/916#discussion_r427883613



##########
File path: src/test/java/org/apache/sysds/test/functions/builtin/BuiltinToOneHotTest.java
##########
@@ -0,0 +1,77 @@
+package org.apache.sysds.test.functions.builtin;
+
+import org.apache.sysds.common.Types;
+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.Arrays;
+import java.util.HashMap;
+
+public class BuiltinToOneHotTest extends AutomatedTestBase {
+    private final static String TEST_NAME = "to_one_hot";
+    private final static String TEST_DIR = "functions/builtin/";
+    private static final String TEST_CLASS_DIR = TEST_DIR + BuiltinToOneHotTest.class.getSimpleName()
+ "/";
+
+    private final static double eps = 0;
+    private final static int rows = 10;
+    private final static int cols = 1;
+    private final static int numClasses = 10;
+
+    @Override
+    public void setUp() {
+        addTestConfiguration(TEST_NAME,new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new
String[]{"B"}));

Review comment:
       I added another test case that checks the stop condition if an incorrect number of
classes is passed. The simple test case already runs on random input and verifies what the
function does using a Java implementation in the test case. However, feel free to add more,
if you deem it necessary. 




----------------------------------------------------------------
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



Mime
View raw message