How does random forest evaluate feature importance?

insert image description here

1. How does random forest evaluate feature importance?

Random forests can evaluate the importance of features in several ways, and these evaluation methods can help you understand which features play a key role in the prediction of the model. The following are some commonly used random forest feature importance evaluation methods:

insert image description here

  1. Mean Decrease Impurity:

    • During the training of each decision tree, each feature is ranked according to the degree of impurity reduction it brings in the decision tree node split.
    • Random Forest calculates the average impurity reduction for each feature across all trees, and then evaluates feature importance based on this average.
    • This method can be feature_importances_obtained through the property.
  2. Mean Decrease Accuracy:

    • In each round of training, Random Forest randomly shuffles the dataset and calculates the accuracy of the model on the original unshuffled data and the shuffled data.
    • The importance of features is measured by the difference in accuracy of the model on the unscrambled data and the shuffled data. </

Guess you like

Origin blog.csdn.net/m0_47256162/article/details/132181900