code: def _log_feature_importance(
      model: Union[CatBoostClassifier, CatBoostRegressor]
  ) -> None:
      """Log feature importance with default settings."""
      if wandb.run is None:
          raise wandb.Error(
              "You must call `wandb.init()` before `_checkpoint_artifact()`"
          )
  
      feat_df = model.get_feature_importance(prettified=True)
  
      fi_data = [
          [feat, feat_imp]
          for feat, feat_imp in zip(
              feat_df["Feature Id"], feat_df["Importances"]
          )
      ]
      table = wandb.Table(
          data=fi_data, columns=["Feature", "Importance"]
      )
      # todo: replace with wandb.run._log once available
      wandb.log(
          {
              "Feature Importance": wandb.plot.bar(
                  table,
                  "Feature",
                  "Importance",
                  title="Feature Importance",
              )
          },
          commit=False,
      )
  
file_path: wandb/wandb/integration/catboost/catboost.py
imports: from pathlib import Path
  from types import SimpleNamespace
  from typing import List, Union
  from catboost import CatBoostClassifier, CatBoostRegressor
  import wandb
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 2 for calling a global function with example usage: _log_feature_importance(model) without return types