njayaram2 commented on a change in pull request #357: Utilities: Add one-hot
encode for dependent variable in Minibatch DL
URL: https://github.com/apache/madlib/pull/357#discussion_r267471529
##########
File path: src/ports/postgres/modules/utilities/minibatch_preprocessing.py_in
##########
@@ -448,6 +345,131 @@ class MiniBatchPreProcessor:
plpy.execute(query)
+class MiniBatchPreProcessorDL(MiniBatchPreProcessor):
+ def __init__(self, schema_madlib, source_table, output_table,
+ dependent_varname, independent_varname, buffer_size,
+ normalizing_const=1.0, **kwargs):
+ self.schema_madlib = schema_madlib
+ self.source_table = source_table
+ self.output_table = output_table
+ self.dependent_varname = dependent_varname
+ self.independent_varname = independent_varname
+ self.buffer_size = buffer_size
+ self.normalizing_const = normalizing_const if normalizing_const else
1.0
+ self.module_name = "minibatch_preprocessor_DL"
+ self.output_summary_table = add_postfix(self.output_table, "_summary")
+ self._validate_args()
+ self.num_of_buffers = self._get_num_buffers()
+ self.to_one_hot_encode = True
+ if is_valid_psql_type(self.dependent_vartype, NUMERIC | ONLY_ARRAY):
+ self.dependent_levels = None
+ else:
+ self.dependent_levels = get_distinct_col_levels(
+ self.source_table, self.dependent_varname,
self.dependent_vartype)
+
+
+ def minibatch_preprocessor_dl(self):
+ # Create a temp table that has independent var normalized.
+ norm_tbl = unique_string(desp='normalized')
+
+ dependent_varname_with_offset = self.dependent_varname
Review comment:
We don't need this anymore.
----------------------------------------------------------------
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