I'm trying to calculate the importance (in percentage) of each variable in my model (using smileRandomForest) in GEE.
var RFmodel = ee.Classifier.smileRandomForest(1000).train(trainingData, 'classID', predictionBands);
var var_imp = ee.Feature(null, ee.Dictionary(RFmodel.explain()).get('importance'));
In the example above, "var_imp" is a feature that has "importance" as a property. To calculate importance as %, I'm assuming I'll need to do something like:
Importance (%) = (variable importance value)/(total sum of all importance variables) * 100
Can someone help me to write a function for this? I'm relatively new to GEE and have no idea where to start. I've tried using aggregate_sum() at least to sum all variables, but "var_imp" isn't a FeatureCollection so it doesn't work.