Feature importance, also called as Gini importance or Mean Decrease Impurity (MDI)[1]}, [2]}, [3]}, is the average of node impurity decrease of each variable and weighted by the probability of the sample reaching to that node. For Random-Forest model, assumes that the response is \(Y\)  and to calculate the average variable importance of feature \(X_i\)  with \(N\)  trees:
\(Imp(X_i) = \frac{1}{N} \sum _{T=1}^{N} \sum _{j\in T: v(s_j)=X_m} p(j) \Delta i(s_j, j)\) 
