RF_PREDICTOR_IMPORTANCE
Measures the importance of the predictors in a random forest model using the Mean Decrease Impurity (MDI) approach.
Syntax
RF_PREDICTOR_IMPORTANCE ( USING PARAMETERS model_name='model‑name' [, tree_id=tree‑id] )
Parameter Settings
| Parameter name | Set to… |
|---|---|
model_name
|
Identifies the model that is stored as a result of the training, where model‑name must be of type |
| tree‑id |
Identifies the tree to process, an integer between 0 and n-1, where n is the number of trees in the forest. If you omit this parameter, the function uses all trees to measure importance values. |
Privileges
Non-superusers: USAGE privileges on the model
Examples
This example shows how you can use the RF_PREDICTOR_IMPORTANCE function.
=> SELECT RF_PREDICTOR_IMPORTANCE ( USING PARAMETERS model_name = 'myRFModel', tree_id=1); predictor_index | predictor_name | importance_value
----------------+----------------+------------------- 0 | sepal_length | 0 1 | sepal_width | 0 2 | petal_length | 0.200289855072464 3 | petal_wdith | 0 (4 rows)