khannaekta commented on a change in pull request #384: MLP - Fixed column names
in the Output Table
URL: https://github.com/apache/madlib/pull/384#discussion_r280658918
##########
File path: src/ports/postgres/modules/convex/mlp_igd.py_in
##########
@@ -1048,14 +1050,8 @@ def mlp_predict(schema_madlib, model_table, data_table,
id_col_name,
else:
intermediate_col = unique_string()
if classes:
- # we cannot call sql quote_ident on the class value because
- # aliasing does not support quote_ident. Hence calling our
- # python implementation of quote_ident
- score_format = ',\n'.join([
- 'CAST({interim}[{j}] as DOUBLE PRECISION) as "{c_str}"'.
- format(j=i + 1, c_str=quote_ident("estimated_prob_{0}".
- format(str(c))).strip(' "'), interim=intermediate_col)
- for i, c in enumerate(classes)])
+ score_format = create_cols_from_array_sql_string(
+ classes, intermediate_col, 'prob', 'double precision',
False, 'convex')
Review comment:
LGTM.
One minor comment - module name passed in should be ‘MLP’ instead of
‘convex’.
----------------------------------------------------------------
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