Github user iyerr3 commented on a diff in the pull request: https://github.com/apache/madlib/pull/237#discussion_r169846145 --- Diff: src/ports/postgres/modules/convex/mlp_igd.py_in --- @@ -796,14 +807,34 @@ def mlp_predict(schema_madlib, else: # if not grouping, then directly read out the coeff, mean # and std values from the model and standardization tables. - standardization = plpy.execute( - "SELECT * FROM {0}".format(standardization_table))[0] + + # Fix to ensure that 1.12 models run on 1.13 or higher. + # As a result of adding grouping support in 1.13, the following change + # was also made wrt standardization. The x_mean and x_std + # values were stored in the summary table itself in MADlib 1.12, and + # they were named as: x_means and x_stds. + # From MADlib 1.13 onwards, these parameters were moved to the + # _standardization table, and were renamed to mean and std. + if is_v112_model: --- End diff -- I feel we can simplify by creating two SQL strings and avoid all the variables: ``` if pre_113: SELECT x_means as mean, x_stds as std FROM {summary_table} else: SELECT mean, std FROM {standardization_table} ```
---