Github user mktal commented on a diff in the pull request:
https://github.com/apache/incubator-madlib/pull/35#discussion_r58963449
--- Diff: src/ports/postgres/modules/convex/utils_regularization.py_in ---
@@ -47,14 +46,22 @@ def __utils_dep_var_scale(**kwargs):
The output will be stored in a temp table: a mean array and a std array
This function is also used in lasso.
+
+ Parameters:
+ schema_madlib -- madlib schema
+ tbl_data -- original data
+ col_ind_var -- independent variables column
+ col_dep_var -- dependent variable column
"""
+
y_scale = plpy.execute(
"""
select
- avg({col_dep_var}) as mean,
+ avg(case when not
{schema_madlib}.array_contains_null({col_ind_var}) then {col_dep_var} end) as
mean,
1 as std
--- End diff --
What if `col_dep_var` contains `null`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---