[ 
https://issues.apache.org/jira/browse/MADLIB-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107744#comment-15107744
 ] 

ASF GitHub Bot commented on MADLIB-952:
---------------------------------------

GitHub user orhankislal opened a pull request:

    https://github.com/apache/incubator-madlib/pull/12

    Bugfix/elastic net type

    Summary: Type error in elastic net
    JIRA: MADLIB-952
    Columns were being checked to ensure every column has the same numeric 
type. While giving an error for non-numeric types is correct, there is no need 
to enforce same numeric type, as the columns are casted inside the function by 
default. The input analyzer is changed to relax this condition.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/orhankislal/incubator-madlib 
bugfix/elastic_net_type

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-madlib/pull/12.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12
    
----
commit 975effb4efb459de67a9ab0390ce3c48f3d0f885
Author: Orhan Kislal <[email protected]>
Date:   2016-01-15T00:42:40Z

    JIRA: MADLIB-954

commit c724f2b53e5d60e40d8d95fa2f0e632427cf6fa9
Author: Orhan Kislal <[email protected]>
Date:   2016-01-15T21:12:05Z

    Summary: Type error in elastic net
    JIRA: MADLIB-952
    Columns were being checked to ensure every column has the same numeric 
type. While giving an error for non-numeric types is correct, there is no need 
to enforce same numeric type, as the columns are casted inside the function by 
default. The input analyzer is changed to relax this condition.

----


> Type error in elastic net
> -------------------------
>
>                 Key: MADLIB-952
>                 URL: https://issues.apache.org/jira/browse/MADLIB-952
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Module: Regularized Regression
>            Reporter: Frank McQuillan
>            Priority: Minor
>             Fix For: v1.9
>
>
> First check the columns which are text or character using the following code: 
> select 
>    column_name, data_type
> from 
>    information_schema.columns
>    where table_schema='analytics'
>    and table_name='discharge_train' 
>    and data_type in ('character varying','text')
> It gave me the following result. 
> "cohort_assignment";"text"
> "providergender";"character varying"
> "locationname";"character varying"
> "patientkey";"character varying"
> Then this is the code I used for elastic net. 
> DROP TABLE IF EXISTS analytics.elastic_net_logistic;
> SELECT madlib.elastic_net_train( 'analytics.discharge_train',
>                                  'analytics.elastic_net_train_result',
>                                  'readmission < 0',
>                                  '*',
>                                  'binomial',
>                                  0.6,
>                                  0.02,
>                                  TRUE,
>                                  NULL,
>                                  'fista',
>                                  '',
>                                 'totalemergencyvisits_in_current_visit  , 
> totalgimvisits_in_current_visit  , 
>                                   totalcardiologyvisits_in_current_visit  , 
> total_time_in_medical_short_inpatient  , 
>                                   totalacupulmonaryvisits_in_current_visit  , 
> current_complain_  ,
>                                   total_current_dea_ciii, 
> curr_rx_gen_lactated_ringers  ,patientkey  , 
>                                   totalobservationvisits_in_current_visit, 
> total_unitsvisited_before_admission  , 
>                                   totalpcuneurovisits_in_current_visit , 
> totalicuvisits_in_current_visit  ,curr_rx_gen_oxycodone_w_  , 
>                                   total_time_in_medical_short_in_er , 
> totalmfmvisits_in_current_visit  , 
>                                   totalmedsurgvisits_in_current_visit  , 
> hospitalaccountrecord, inpatientadmitdatetime  
> ,totalongvisits_in_current_visit,
>                                   
> no_null_days_btw_admissions,cohort_assignment,locationname,providergender,patientkey',
>                                  10000,
>                                  1e-6
>                                );
> If you check in exlcuded list of variables, at the very last I have excluded 
> the character or text variables. 
> It still gives me this error. 
>                            Elastic Net error: All columns to be included in 
> the
>                            independent variables should be of the same 
> numeric type.
> Context: Traceback (most recent call last):
>   PL/Python function "elastic_net_train", line 23, in <module>
>     return elastic_net.elastic_net_train(**globals())
>   PL/Python function "elastic_net_train", line 308, in elastic_net_train
>   PL/Python function "elastic_net_train", line 427, in analyze_input_str
> PL/Python function "elastic_net_train"
> Please note I have also tried by dropping all the character or text variables 
> and then passing it to elastic net code. And it still gives me the same error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to