Github user kaknikhil commented on a diff in the pull request:
https://github.com/apache/madlib/pull/243#discussion_r175889157
--- Diff: src/ports/postgres/modules/convex/mlp_igd.py_in ---
@@ -590,51 +664,103 @@ def _validate_warm_start(output_table,
summary_table, standardization_table,
output_table + ". Invalid number of coefficients in
model.")
return coeff
+def _validate_dependent_var(source_table, dependent_varname,
+ is_classification, is_minibatch_enabled):
+ expr_type = get_expr_type(dependent_varname, source_table)
+ int_types = ['integer', 'smallint', 'bigint']
+ text_types = ['text', 'varchar', 'character varying', 'char',
'character']
+ boolean_types = ['boolean']
+ float_types = ['double precision', 'real']
+ classification_types = int_types + boolean_types + text_types
+ regression_types = int_types + float_types
+ validate_type = classification_types if is_classification else
regression_types
--- End diff --
I think it's slightly cleaner if we don't use the `validate_type ` variable
but use the `classification_types` and `regression_types ` variables.
---