Github user iyerr3 commented on a diff in the pull request: https://github.com/apache/madlib/pull/295#discussion_r203812338 --- Diff: src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in --- @@ -2327,6 +2328,110 @@ def _tree_error(schema_madlib, source_table, dependent_varname, plpy.execute(sql) # ------------------------------------------------------------ +def _validate_var_importance_input(model_table, summary_table, output_table): + _assert(table_exists(model_table), + "Recursive Partitioning: Model table does not exist.") + _assert(table_exists(summary_table), + "Recursive Partitioning: Model summary table does not exist.") + _assert(not table_exists(output_table), + "Recursive Partitioning: Output table already exists.") + +def _is_model_for_RF(summary_table): + # Only an RF model (and not DT) would have num_trees column in summary + return columns_exist_in_table(summary_table, ['num_trees']) + +def _is_RF_model_with_imp_pre_1_15(group_table, summary_table): --- End diff -- Since goal of function is to check if `impurity_var_importance` exists in group table, let's name it to reflect that.
---