You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@madlib.apache.org by iyerr3 <gi...@git.apache.org> on 2017/05/02 19:41:53 UTC

[GitHub] incubator-madlib pull request #129: DT/RF: Allow expressions in feature list

GitHub user iyerr3 opened a pull request:

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

    DT/RF: Allow expressions in feature list

    JIRA: MADLIB-1087
    
    Changes:
     - Add numeric as a continuous type
     - Get data type of features from an expression instead of the table
       column names
     - Update to allow expressions in the feature list

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

    $ git pull https://github.com/iyerr3/incubator-madlib bugfix/rf_feature_input

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

    https://github.com/apache/incubator-madlib/pull/129.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 #129
    
----
commit 4d18b07d69ae20475254245d65798b61edce1f31
Author: Rahul Iyer <ri...@apache.org>
Date:   2017-05-02T19:39:52Z

    DT/RF: Allow expressions in feature list
    
    JIRA: MADLIB-1087
    
    Changes:
     - Add numeric as a continuous type
     - Get data type of features from an expression instead of the table
       column names
     - Update to allow expressions in the feature list

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #129: DT/RF: Allow expressions in feature list

Posted by njayaram2 <gi...@git.apache.org>.
Github user njayaram2 commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/129#discussion_r114846053
  
    --- Diff: src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in ---
    @@ -157,25 +150,24 @@ def _classify_features(feature_to_type, features):
         cat_types = int_types + text_types + boolean_types
         ordered_cat_types = int_types
     
    -    cat_features = [c for c in features
    -                    if _dict_get_quoted(feature_to_type, c) in cat_types]
    -    ordered_cat_features = [c for c in features if _dict_get_quoted(
    -                            feature_to_type, c) in ordered_cat_types]
    +    cat_features = [c for c in features if feature_to_type[c] in cat_types]
    +    ordered_cat_features = [c for c in features
    +                            if feature_to_type[c] in ordered_cat_types]
     
         cat_features_set = set(cat_features)
         # continuous types - 'real' is cast to 'double precision' for uniformity
    -    con_types = ['real', 'float8', 'double precision']
    +    con_types = ['real', 'float8', 'double precision', 'numeric']
         con_features = [c for c in features
                         if (c not in cat_features_set and
    --- End diff --
    
    do we need to check if `c not in cat_features_set`? At the moment, it seems like `cat_types` and `con_types` are mutually exclusive.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #129: DT/RF: Allow expressions in feature list

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---