docstr: Returns a dataframe with feature importance for the model.
code: def feature_importance(self) -> DataFrame:
      """Returns a dataframe with feature importance for the model."""
      if hasattr(self.backbone, "feature_importance_"):
          imp = self.backbone.feature_importance_
          n_feat = len(
              self.hparams.categorical_cols
              + self.hparams.continuous_cols
          )
          if self.hparams.categorical_dim > 0:
              if imp.shape[0] != n_feat:
                  # Combining Cat Embedded Dimensions to a single one by averaging
                  wt = []
                  norm = []
                  ft_idx = 0
                  for _, embd_dim in self.hparams.embedding_dims:
                      wt.extend([ft_idx] * embd_dim)
                      norm.append(embd_dim)
                      ft_idx += 1
                  for _ in self.hparams.continuous_cols:
                      wt.extend([ft_idx])
                      norm.append(1)
                      ft_idx += 1
                  imp = np.bincount(wt, weights=imp) / np.array(norm)
              else:
                  # For models like FTTransformer, we dont need to do anything
                  # It takes categorical and continuous as individual 2-D features
                  pass
          importance_df = DataFrame(
              {
                  "Features": self.hparams.categorical_cols
                  + self.hparams.continuous_cols,
                  "importance": imp,
              }
          )
          return importance_df
      else:
          raise ValueError(
              "Feature Importance unavailable for this model."
          )
  
imports: import importlib
  import warnings
  from abc import ABCMeta, abstractmethod
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from omegaconf import DictConfig, OmegaConf
  from pandas import DataFrame
  from torch import Tensor
  from torch.optim import Optimizer
  from pytorch_tabular.models.common.heads import blocks
  from pytorch_tabular.models.common.layers import PreEncoded1dLayer
  from pytorch_tabular.utils import get_logger, reset_all_weights
label_desc: Use image node_id 30 for calling the BaseModel obj's underlying member method code with example usage: obj.feature_importance() and returns: importance_df