code: def explain_weights_catboost(
      catb,
      vec=None,
      top=20,
      importance_type="PredictionValuesChange",
      feature_names=None,
      pool=None,
  ):
      """
      Return an explanation of an CatBoost estimator (CatBoostClassifier,
      CatBoost, CatBoostRegressor) as feature importances.
  
      See :func:`eli5.explain_weights` for description of
      ``top``, ``feature_names``,
      ``feature_re`` and ``feature_filter`` parameters.
  
      ``target_names`` and ``targets`` parameters are ignored.
  
      Parameters
      ----------
      :param 'importance_type' : str, optional
          A way to get feature importance. Possible values are:
  
          - 'PredictionValuesChange' (default) - The individual importance
            values for each of the input features.
          - 'LossFunctionChange' - The individual importance values for
            each of the input features for ranking metrics
            (requires training data to be passed or a similar dataset with Pool)
  
      :param 'pool' : catboost.Pool, optional
          To be passed if explain_weights_catboost has importance_type set
          to LossFunctionChange. The catboost feature_importances uses the Pool
          datatype to calculate the parameter for the specific importance_type.
      """
      is_regression = _is_regression(catb)
      catb_feature_names = catb.feature_names_
      coef = _catb_feature_importance(
          catb, importance_type=importance_type, pool=pool
      )
      return get_feature_importance_explanation(
          catb,
          vec,
          coef,
          feature_names=feature_names,
          estimator_feature_names=catb_feature_names,
          feature_filter=None,
          feature_re=None,
          top=top,
          description=DESCRIPTION_CATBOOST,
          is_regression=is_regression,
          num_features=coef.shape[-1],
      )
  
file_path: eli5/eli5/catboost.py
imports: from __future__ import absolute_import, division
  import numpy
  import catboost
  from eli5.explain import explain_weights
  from eli5._feature_importances import get_feature_importance_explanation
label_desc: Use image node_id 1 for calling a global function with example usage: explain_weights_catboost(catb, vec, top, importance_type, feature_names, pool) and returns: get_feature_importance_explanation