You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by "e-strauss (via GitHub)" <gi...@apache.org> on 2024/09/02 18:37:31 UTC

[PR] [SYSTEMDS-3741] Python API Builtin countDistinctApprox [systemds]

e-strauss opened a new pull request, #2088:
URL: https://github.com/apache/systemds/pull/2088

   [SYSTEMDS-3741] Python API Builtin countDistinctApprox
   
   This patch adds the builtin operator for countDistinctApprox to the python api.


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

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

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


Re: [PR] [SYSTEMDS-3741] Python API Builtin countDistinctApprox [systemds]

Posted by "Baunsgaard (via GitHub)" <gi...@apache.org>.
Baunsgaard closed pull request #2088: [SYSTEMDS-3741] Python API Builtin countDistinctApprox
URL: https://github.com/apache/systemds/pull/2088


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

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

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


Re: [PR] [SYSTEMDS-3741] Python API Builtin countDistinctApprox [systemds]

Posted by "Baunsgaard (via GitHub)" <gi...@apache.org>.
Baunsgaard commented on code in PR #2088:
URL: https://github.com/apache/systemds/pull/2088#discussion_r1741808291


##########
src/main/python/systemds/operator/nodes/matrix.py:
##########
@@ -244,6 +244,21 @@ def min(self, axis: int = None) -> 'OperationNode':
         raise ValueError(
             f"Axis has to be either 0, 1 or None, for column, row or complete {self.operation}")
 
+    def countDistinctApprox(self, axis: int = None) -> 'OperationNode':
+        """Calculate the approximate number of distinct values of matrix.
+
+        :param axis: can be 0 or 1 to do either row or column aggregation
+        :return: `Matrix` representing operation
+        """
+        if axis == 0:
+            return Matrix(self.sds_context, 'colCountDistinctApprox', [self])
+        elif axis == 1:
+            return Matrix(self.sds_context, 'rowCountDistinctApprox', [self])
+        elif axis is None:
+            return Scalar(self.sds_context, 'countDistinctApprox', [self])
+        raise ValueError(
+            f"Axis has to be either 0, 1 or None, for column, row or complete {self.operation}")

Review Comment:
   similarly here, we are missing a test case for the error.



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

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

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


Re: [PR] [SYSTEMDS-3741] Python API Builtin countDistinctApprox [systemds]

Posted by "Baunsgaard (via GitHub)" <gi...@apache.org>.
Baunsgaard commented on PR #2088:
URL: https://github.com/apache/systemds/pull/2088#issuecomment-2326991520

   LGTM, and Merged


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

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

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