Feature importance values indicate which fields had the biggest impact on eachprediction that is generated by classification or regression analysis. Eachfeature importance value has both a magnitude and a direction (positive or negative),which indicate how each field (or feature of a data point) affects aparticular prediction.
The purpose of feature importance is to help you determine whether the predictions aresensible. Is the relationship between the dependent variable and the importantfeatures supported by your domain knowledge? The lessons you learn about theimportance of specific features might also affect your decision to include themin future iterations of your trained model.
You can see the average magnitude of the feature importance values for each field acrossall the training data in Kibana or by using theget trained model API. For example, Kibana shows thetotal feature importance for each field in regression or binaryclassification analysis results as follows:
If the classification analysis involves more than two classes, Kibana uses colors to showhow the impact of each field varies by class. For example:
You can also examine the feature importance values for each individualprediction. In Kibana, you can see these values in JSON objects or decision plots.For regression analysis, each decision plot starts at a shared baseline, which isthe average of the prediction values for all the data points in the trainingdata set. When you add all of the feature importance values for a particulardata point to that baseline, you arrive at the numeric prediction value. If afeature importance value is negative, it reduces the prediction value. If a feature importancevalue is positive, it increases the prediction value. For example:
For classification analysis, the sum of the feature importance values approximates the predictedlogarithm of odds for each data point. The simplest way to understand feature importancein the context of classification analysis is to look at the decision plots in Kibana. Foreach data point, there is a chart which shows the relative impact of eachfeature on the prediction probability for that class. This information helps youto understand which features reduces or increase the prediction probability. Forexample:
By default, feature importance values are not calculated. To generate this information,when you create a data frame analytics job you must specify thenum_top_feature_importance_values
property. For example, seePerforming regression analysis in the sample flight data set and Performing classification analysis in the sample flight data set.
The feature importance values are stored in the machine learning results field for each document inthe destination index. The number of feature importance values for each document mightbe less than the num_top_feature_importance_values
property value. For example,it returns only features that had a positive or negative effect on theprediction.
- Feature importance in the Elastic Stack is calculated using the SHAP (SHapley AdditiveexPlanations) method as described inLundberg, S. M., & Lee, S.-I. A Unified Approach to Interpreting Model Predictions. In NeurIPS 2017.
- Feature importance for data frame analytics with Elastic machine learning.
- Feature importance for data frame analytics (Jupyter notebook).