reductionista commented on a change in pull request #363: Add tests for
madlib_keras_predict
URL: https://github.com/apache/madlib/pull/363#discussion_r271990122
##########
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:
My understanding is we don't want to treat an empty list as None. Empty
list should return a range error. If the intended behavior is that empty list
should return the index, then we should change the doc string to say that
(currently says None is used for that purpose).
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services