catboost.get_feature_importance {catboost}R Documentation

Calculate the feature importances

Description

Calculate the feature importances (see https://catboost.ai/docs/concepts/fstr.html#fstr) (Regular feature importance, ShapValues, and Feature interaction strength).

Usage

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

Arguments

model

The model obtained as the result of training.

Default value: Required argument

pool

The input dataset.

The feature importance for the training dataset is calculated if this argument is not specified. Models with ranking metrics require pool argument to calculate feature importance.

Default value: NULL

type

The feature importance type.

Possible values:

  • 'PredictionValuesChange'

    Calculate score for every feature.

  • 'LossFunctionChange'

    Calculate score for every feature for groupwise model.

  • 'FeatureImportance'

    'LossFunctionChange' in case of groupwise model and 'PredictionValuesChange' otherwise.

  • 'Interaction'

    Calculate pairwise score between every feature.

  • 'ShapValues'

    Calculate SHAP Values for every object.

Default value: 'FeatureImportance'

thread_count

The number of threads to use when applying the model. If -1, then the number of threads is set to the number of CPU cores.

Allows you to optimize the speed of execution. This parameter doesn't affect results.

Default value: -1

fstr_type

Deprecated parameter, use 'type' instead.

Value

Feature importances

See Also

https://catboost.ai/docs/features/feature-importances-calculation.html


[Package catboost version 1.0.4 Index]