Github user jingyimei commented on a diff in the pull request:
https://github.com/apache/madlib/pull/289#discussion_r201462356
--- Diff:
src/ports/postgres/modules/recursive_partitioning/random_forest.py_in ---
@@ -616,23 +628,20 @@ def forest_train(
_calculate_oob_error(schema_madlib, oob_prediction_table,
oob_error_table, id_col_name,
is_classification)
-
- importance_table = unique_string()
- sql_create_empty_imp_tbl = """
- CREATE TEMP TABLE {importance_table}
- (
- gid integer,
- cat_var_importance float8[],
- con_var_importance float8[]
- );
- """.format(**locals())
-
plpy.notice("sql_create_empty_imp_tbl:\n"+sql_create_empty_imp_tbl)
- plpy.execute(sql_create_empty_imp_tbl)
-
- # we populate the importance_table only if variable
importance is to be
- # calculated, otherwise we use an empty table which will
be used later
- # for an outer join.
+ importance_table = ''
if importance:
+ importance_table = unique_string()
+ sql_create_empty_imp_tbl = """
+ CREATE TEMP TABLE {importance_table}
+ (
+ gid integer,
+ cat_var_importance float8[],
+ con_var_importance float8[]
+ );
+ """.format(**locals())
+
plpy.notice("sql_create_empty_imp_tbl:\n"+sql_create_empty_imp_tbl)
--- End diff --
Do we need this notice?
---