madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [madlib] njayaram2 commented on a change in pull request #363: Add tests for madlib_keras_predict
Date Wed, 03 Apr 2019 23:31:16 GMT
njayaram2 commented on a change in pull request #363: Add tests for madlib_keras_predict
URL: https://github.com/apache/madlib/pull/363#discussion_r271964134
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras_predict.py_in
 ##########
 @@ -108,12 +108,15 @@ def _get_class_label(class_values, class_index):
         scalar. If class_values is None, returns class_index, else returns
         class_values[class_index].
     """
-    if class_values:
-        if class_index < len(class_values):
-            return class_values[class_index]
-        else:
-            plpy.error("Invalid class index {0} returned from Keras predict. "\
-                "Index value must be less than {1}".format(
+    if class_values is None:
 
 Review comment:
   Generally `if not class_values:` is better, that will filter out empty lists too.

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


With regards,
Apache Git Services

Mime
View raw message