docstr: Transforms the categorical columns specified to the trained neural features from the model.
  
  Args:
      X (pd.DataFrame): DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
      y ([type], optional): Only for compatibility. Not used. Defaults to None.
  
  Raises:
      ValueError: [description]
  
  Returns:
      pd.DataFrame: The encoded dataframe
docstr_tok: ["Transforms","the","categorical","columns","specified","to","the","trained","neural","features","from","the","model",".","Args",":","X","(","pd.DataFrame",")",":","DataFrame","of","features",",","shape","(","n_samples",",","n_features",")",".","Must","contain","columns","to","encode",".","y","(","[","type","]",",","optional",")",":","Only","for","compatibility",".","Not","used",".","Defaults","to","None",".","Raises",":","ValueError",":","[","description","]","Returns",":","pd.DataFrame",":","The","encoded","dataframe"]
code: def transform(self, X: pd.DataFrame, y=None) -> pd.DataFrame:
      """Transforms the categorical columns specified to the trained neural features from the model.
  
      Args:
          X (pd.DataFrame): DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
          y ([type], optional): Only for compatibility. Not used. Defaults to None.
  
      Raises:
          ValueError: [description]
  
      Returns:
          pd.DataFrame: The encoded dataframe
      """
  
      X_encoded = X.copy(deep=True)
      orig_features = X_encoded.columns
      self.tabular_model.model.eval()
      inference_dataloader = (
          self.tabular_model.datamodule.prepare_inference_dataloader(
              X_encoded
          )
      )
      logits_predictions = defaultdict(list)
      for batch in track(
          inference_dataloader, description="Generating Features..."
      ):
          for k, v in batch.items():
              if isinstance(v, list) and (len(v) == 0):
                  # Skipping empty list
                  continue
              batch[k] = v.to(self.tabular_model.model.device)
          if self.tabular_model.config.task == "ssl":
              ret_value = {
                  "backbone_features": self.tabular_model.model.predict(
                      batch, ret_model_output=True
                  )
              }
          else:
              _, ret_value = self.tabular_model.model.predict(
                  batch, ret_model_output=True
              )
          for k in self.extract_keys:
              if k in ret_value.keys():
                  logits_predictions[k].append(
                      ret_value[k].detach().cpu()
                  )
  
      for k, v in logits_predictions.items():
          v = torch.cat(v, dim=0).numpy()
          if v.ndim == 1:
              v = v.reshape(-1, 1)
          for i in range(v.shape[-1]):
              if v.shape[-1] > 1:
                  X_encoded[f"{k}_{i}"] = v[:, i]
              else:
                  X_encoded[f"{k}"] = v[:, i]
  
      if self.drop_original:
          X_encoded.drop(columns=orig_features, inplace=True)
      return X_encoded
  
file_path: pytorch_tabular/src/pytorch_tabular/feature_extractor.py
imports: from collections import defaultdict
  import pandas
  from rich.progress import track
  from sklearn.base import BaseEstimator, TransformerMixin
  from pytorch_tabular.models import NODEModel, TabNetModel
  from pytorch_tabular.models.mixture_density import MDNModel
  import torch
label_desc: Use image node_id 3 for calling the DeepFeatureExtractor obj's underlying member method code with example usage: obj.transform(X, y) and returns: X_encoded