neurorestore / Augur

Cell type prioritization in single-cell data
MIT License
91 stars 10 forks source link

Feature importance score #12

Open gaelcge opened 2 years ago

gaelcge commented 2 years ago

Hi I am wondering whether how we could output feature importance score from the model. Thanks a lot for this package! Gael

jordansquair commented 2 years ago

Hi Gael,

You can grab it from the feature_importance slot of the output structure of calculate_auc

nadinegheziel commented 1 year ago

Hello, Thank you very much for your great work!

I was wondering how you calculated the values of importance ? Is it a z-score since some values are negatives ?

Thank you again, Nadine G

skinnider commented 1 year ago

Hi Nadine, sorry for the delay getting back to you. The feature importances are the values returned by the randomForest package:

          if (mode == 'regression') {
            if (rf_params$importance == 'accuracy') {
              impval_name = "%IncMSE"
            } else {
              impval_name = 'IncNodePurity'
            }
          } else {
            if (rf_params$importance == 'accuracy') {
              impval_name = 'MeanDecreaseAccuracy'
            } else {
              impval_name = 'MeanDecreaseGini'
            }
          }

You can do ?randomForest for documentation on these but they can indeed be negative. The importances are then averaged across repeated subsamples to get the mean value across n_subsamples subsamples (default, 50).