Skip to Main Content Skip to Search
Product Documentation

predictorImportance - Class: CompactClassificationEnsemble

Estimates of predictor importance

Syntax

imp = predictorImportance(ens)
[imp,ma] = predictorImportance(ens)

Description

imp = predictorImportance(ens) computes estimates of predictor importance for ens by summing these estimates over all weak learners in the ensemble. imp has one element for each input predictor in the data used to train this ensemble. A high value indicates that this predictor is important for ens.

[imp,ma] = predictorImportance(ens) returns a P-by-P matrix with predictive measures of association for P predictors, when the learners in ens contain surrogate splits. See Definitions.

Input Arguments

ens

A classification ensemble created by fitensemble, or by the compact method.

Output Arguments

imp

A row vector with the same number of elements as the number of predictors (columns) in ens.X. The entries are the estimates of predictor importance, with 0 representing the smallest possible importance.

ma

A P-by-P matrix of predictive measures of association for P predictors. Element ma(I,J) is the predictive measure of association averaged over surrogate splits on predictor J for which predictor I is the optimal split predictor. predictorImportance averages this predictive measure of association over all trees in the ensemble.

Definitions

Predictor Importance

predictorImportance computes estimates of predictor importance for ens by summing changes in the risk due to splits on every predictor and dividing the sum by the number of tree nodes. If ens is grown without surrogate splits, this sum is taken over best splits found at each branch node. If ens is grown with surrogate splits, this sum is taken over all splits at each branch node including surrogate splits. imp has one element for each input predictor in the data used to train ens. Predictor importance associated with this split is computed as the difference between the risk for the parent node and the total risk for the two children.

Impurity and Node Error

ClassificationTree splits nodes based on either impurity or node error. Impurity means one of several things, depending on your choice of the SplitCriterion name-value pair:

Predictive Measure of Association

The predictive measure of association between the optimal split on variable i and a surrogate split on variable j is:

Here

Clearly, λi,j lies from –∞ to 1. Variable j is a worthwhile surrogate split for variable i if λi,j > 0.

Element ma(i,j) is the predictive measure of association averaged over surrogate splits on predictor j for which predictor i is the optimal split predictor. This average is computed by summing positive values of the predictive measure of association over optimal splits on predictor i and surrogate splits on predictor j and dividing by the total number of optimal splits on predictor i, including splits for which the predictive measure of association between predictors i and j is negative.

Examples

Estimate the predictor importance for all variables in the Fisher iris data:

load fisheriris
ens = fitensemble(meas,species,'AdaBoostM2',100,'Tree');
imp = predictorImportance(ens)

imp =
    0.0001    0.0005    0.0384    0.0146

The first two predictors are not very important in ens.

 

Estimate the predictor importance for all variables in the Fisher iris data for an ensemble where the trees contain surrogate splits:

load fisheriris
surrtree = ClassificationTree.template('Surrogate','on');
ens2 = fitensemble(meas,species,'AdaBoostM2',100,surrtree);
[imp2,ma] = predictorImportance(ens2)

imp2 =
    0.0224    0.0142    0.0525    0.0508

ma =
    1.0000         0    0.0001    0.0001
    0.0115    1.0000    0.0023    0.0054
    0.2810    0.1747    1.0000    0.5372
    0.0789    0.0463    0.2339    1.0000

The first two predictors show much more importance than in the previous example.

See Also

predictorImportance

How To

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS