Github user mktal commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/35#discussion_r59062743
  
    --- 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 --
    
    @decibel that is a good point. I agree that for `avg()` function 
`col_dep_var` containing NULLs is not a problem. But what I meant is that it 
will be a problem for normalizing the `col_ind_var` because in that case we 
cannot treat `col_ind_var` and `col_dep_var` independently as we are currently 
doing. 


---
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.
---

Reply via email to