I am doing a simple Random Forest classification in Google Earth Engine. I try to classify upland, water and wetlands, using 25 variables derived from one year of Sentinel-1 images. The classifier works well and the accuracy is okay, but now I want to calculate a variable importance for my classifier.

There seems to be no function in Earth Engine for calculating variable importance. The only workaround I could think of is exporting the stacked image to R, and do the classification there. However, this might be a complicated solution, due to the size of the study area and the high number of variables. Is there a simple work-around to calculate variable importance in Earth Engine?

1 Answer 1


No easy easy way to compute variable importance (yet) but you could try computing your accuracy multiple times, withholding one column each time. The largest decrease in accuracy will correspond to withholding the most important variable. then repeat leaving that one in and withholding the other N-1 columns, 1 at a time. etc.

  • 1
    I would like to know that is there any GEE JavaScript code available for performing this task?
    – user95904
    Commented Jan 5, 2020 at 6:30
  • I would guess this has not changed in the last 2 years? Or do I just not find the function in GEE?
    – s6hebern
    Commented Nov 26, 2020 at 14:32
  • 5
    The smileRandomForest classifier has variable importance as output from the explain() function. Commented Nov 27, 2020 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.