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 2018/04/18 05:08:43 UTC

madlib git commit: RF: Default optional args in predict to None

Repository: madlib
Updated Branches:
  refs/heads/master 47007aa29 -> bc88a1051


RF: Default optional args in predict to None

Upgrading from v1.11 to v1.14 led to an error if a user had models
trainined in the older version and then predicted using the newer
version. This was due to a newly introduced argument ('null_proxy')
missing from the model summary table. This argument is optional and can
be set to NULL/None if missing.


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

Branch: refs/heads/master
Commit: bc88a10512cd85f5d42d13289bd2b52c81b7401e
Parents: 47007aa
Author: Rahul Iyer <ri...@apache.org>
Authored: Tue Apr 17 22:06:26 2018 -0700
Committer: Rahul Iyer <ri...@apache.org>
Committed: Tue Apr 17 22:06:26 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/madlib/blob/bc88a105/src/ports/postgres/modules/recursive_partitioning/random_forest.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/recursive_partitioning/random_forest.py_in b/src/ports/postgres/modules/recursive_partitioning/random_forest.py_in
index c7a3f70..d800f03 100644
--- a/src/ports/postgres/modules/recursive_partitioning/random_forest.py_in
+++ b/src/ports/postgres/modules/recursive_partitioning/random_forest.py_in
@@ -694,12 +694,12 @@ def forest_predict(schema_madlib, model, source, output, pred_type='response',
     cat_features = split_quoted_delimited_str(summary_elements["cat_features"])
     con_features = split_quoted_delimited_str(summary_elements["con_features"])
     id_col_name = summary_elements["id_col_name"]
-    grouping_cols = summary_elements["grouping_cols"]
+    grouping_cols = 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
 
     # pred_type='prob' is allowed only for classification
     _assert(is_classification or pred_type == 'response',