Github user njayaram2 commented on a diff in the pull request:
https://github.com/apache/madlib/pull/295#discussion_r205560164
--- Diff:
src/ports/postgres/modules/recursive_partitioning/random_forest.sql_in ---
@@ -1557,6 +1618,32 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `CONTAINS
SQL', `');
---------------------------------------------------------------------------
---------------------------------------------------------------------------
+/**
+ Helper function to display variable importance scores (both oob and
impurity
+ importance scores for variables).
+**/
+CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.get_var_importance(
+ model_table TEXT,
+ output_table TEXT
+) RETURNS VOID AS $$
+ PythonFunction(recursive_partitioning, random_forest, get_var_importance)
+$$ LANGUAGE plpythonu VOLATILE
+m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `MODIFIES SQL DATA', `');
+
+CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.get_var_importance(
+ message TEXT
+) RETURNS TEXT AS $$
+ PythonFunction(recursive_partitioning, random_forest,
tree_importance_help_message)
--- End diff --
`tree_importance_help_message` is defined in `decision_tree.py_in`, so
`select madlib.get_var_importance()` fails at the moment.
---