catboost.get_feature_importance

catboost.get_feature_importance(model, 
                                pool = NULL, 
                                type = 'FeatureImportance'
                                thread_count = -1)

Purpose

Calculate the feature importances (Feature importance and Feature interaction strength).

Arguments

Argument Description Default value
model

The model obtained as the result of training.

Required argument
pool The input dataset.

The feature importance for the training dataset is calculated if this argument is not specified.

NULL

type

Alias: fstr_type (deprecated, use type instead)

The type of feature importance to calculate.

Possible values:
  • FeatureImportance: Equal to PredictionValuesChange for non-ranking metrics and LossFunctionChange for ranking metrics (the value is determined automatically).

  • ShapValues: A vector with contributions of each feature to the prediction for every input object and the expected value of the model prediction for the object (average prediction given no knowledge about the object).
  • Interaction: The value of the feature interaction strength for each pair of features.

  • PredictionDiff: A vector with contributions of each feature to the RawFormulaVal difference for each pair of objects.
FeatureImportance
thread_count

The number of threads to use during training.

Optimizes the speed of execution. This parameter doesn't affect results.

-1 (the number of threads is equal to the number of processor cores)
Argument Description Default value
model

The model obtained as the result of training.

Required argument
pool The input dataset.

The feature importance for the training dataset is calculated if this argument is not specified.

NULL

type

Alias: fstr_type (deprecated, use type instead)

The type of feature importance to calculate.

Possible values:
  • FeatureImportance: Equal to PredictionValuesChange for non-ranking metrics and LossFunctionChange for ranking metrics (the value is determined automatically).

  • ShapValues: A vector with contributions of each feature to the prediction for every input object and the expected value of the model prediction for the object (average prediction given no knowledge about the object).
  • Interaction: The value of the feature interaction strength for each pair of features.

  • PredictionDiff: A vector with contributions of each feature to the RawFormulaVal difference for each pair of objects.
FeatureImportance
thread_count

The number of threads to use during training.

Optimizes the speed of execution. This parameter doesn't affect results.

-1 (the number of threads is equal to the number of processor cores)