Boosted Tree Regression get_feature_importances() function ignores categorical variables

User 2448 | 1/6/2016, 7:48:57 PM

On this page of the GraphLab Create docs, it is stated that BoostedTreesRegression.get_feature_importance() returns numeric and categorical variables, with an Index column showing the value of the categorical variable. The example output is:

+-----------------------------+-------+-------+
|             name            | index | count |
+-----------------------------+-------+-------+
| DER_mass_transverse_met_lep |  None |   66  |
|         DER_mass_vis        |  None |   65  |
|          PRI_tau_pt         |  None |   61  |
|         DER_mass_MMC        |  None |   59  |
|      DER_deltar_tau_lep     |  None |   58  |
|          DER_pt_tot         |  None |   41  |
|           PRI_met           |  None |   38  |
|     PRI_jet_leading_eta     |  None |   30  |
|     DER_deltaeta_jet_jet    |  None |   27  |
|       DER_mass_jet_jet      |  None |   24  |
+-----------------------------+-------+-------+

However, when I run model.get_feature_importance() on my own model, only numeric features appear and there is no Index column. The docstring for the function shows this example:

+-----------------------------+-------+
|           feature           | count |
+-----------------------------+-------+
|          PRI_tau_pt         |   12  |
| DER_mass_transverse_met_lep |   10  |
|     DER_deltaeta_jet_jet    |   9   |
|         DER_mass_MMC        |   6   |
|         DER_mass_vis        |   5   |
|           DER_pt_h          |   4   |
|           PRI_met           |   4   |
|     PRI_jet_leading_eta     |   3   |
|    DER_lep_eta_centrality   |   2   |
|       DER_mass_jet_jet      |   2   |
+-----------------------------+-------+

Why is there this discrepancy, and how can I get feature importances of categorical variables?

Comments

User 1178 | 1/6/2016, 9:17:07 PM

Hi,

Which version of GraphLab Create are you using? You may get the version by doing

import graphlab
graphlab.version

You might be using an older version of GraphLab Create where the output is different.


User 2448 | 1/6/2016, 10:08:48 PM

Ah, yes, I'm running verson 1.6.1; I'm having trouble updating it due to my corporate proxy, but that's another forum post, I suppose.

Thanks!