You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2017/10/02 05:06:54 UTC

madlib git commit: DT: Make new entry in summary table optional

Repository: madlib
Updated Branches:
  refs/heads/master 8d3969c91 -> 22cb81ca1


DT: Make new entry in summary table optional

JIRA: MADLIB-1161

A new entry ('null_proxy') was added to the summary table, which is
expected by the prediction function. This change disables the use of
older models in the prediction function. Since this entry is optional, a
default value can be used if found missing in summary table.


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/22cb81ca
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/22cb81ca
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/22cb81ca

Branch: refs/heads/master
Commit: 22cb81ca1aec414d6af8f473d371408c9dbfe718
Parents: 8d3969c
Author: Rahul Iyer <ri...@apache.org>
Authored: Mon Oct 2 00:02:36 2017 -0500
Committer: Rahul Iyer <ri...@apache.org>
Committed: Mon Oct 2 00:06:28 2017 -0500

----------------------------------------------------------------------
 .../postgres/modules/recursive_partitioning/decision_tree.py_in  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/22cb81ca/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in b/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
index ce56ab0..88be1a2 100644
--- a/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
+++ b/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
@@ -1752,12 +1752,12 @@ def tree_predict(schema_madlib, model, source, output, pred_type='response',
         "Decision tree error: Missing columns in predict data table ({0}) "
         "that were used during training".format(source))
     id_col_name = summary_elements["id_col_name"]
-    grouping_cols_str = summary_elements["grouping_cols"]
+    grouping_cols_str = summary_elements.get("grouping_cols")  # optional, default = None
     dep_varname = summary_elements["dependent_varname"]
     dep_levels = summary_elements["dependent_var_levels"]
     is_classification = summary_elements["is_classification"]
     dep_type = summary_elements['dependent_var_type']
-    null_proxy = summary_elements['null_proxy']
+    null_proxy = summary_elements.get('null_proxy')  # optional, default = None
 
     # find which columns are of type boolean
     boolean_cats = set([key for key, value in get_cols_and_types(source)