docstr: Extract features for each sample, i.e., one row in the provided dataframe `data`.
  
  Parameters
  ----------
  data
      The data to extract embeddings for. Should contain same column names as training dataset and
      follow same format (except for the `label` column).
  as_tensor
      Whether to return a Pytorch tensor.
  as_pandas
      Whether to return the output as a pandas DataFrame (True) or numpy array (False).
  realtime
      Whether to do realtime inference, which is efficient for small data (default False).
      If provided None, we would infer it on based on the data modalities
      and sample number.
  
  Returns
  -------
  Array of embeddings, corresponding to each row in the given data.
  It will have shape (#samples, D) where the embedding dimension D is determined
  by the neural network's architecture.
code: def extract_embedding(
      self,
      data: pd.DataFrame,
      realtime: Optional[bool] = False,
      as_tensor: Optional[bool] = False,
      as_pandas: Optional[bool] = False,
      **kwargs,
  ):
      """
      Extract features for each sample, i.e., one row in the provided dataframe `data`.
  
      Parameters
      ----------
      data
          The data to extract embeddings for. Should contain same column names as training dataset and
          follow same format (except for the `label` column).
      as_tensor
          Whether to return a Pytorch tensor.
      as_pandas
          Whether to return the output as a pandas DataFrame (True) or numpy array (False).
      realtime
          Whether to do realtime inference, which is efficient for small data (default False).
          If provided None, we would infer it on based on the data modalities
          and sample number.
  
      Returns
      -------
      Array of embeddings, corresponding to each row in the given data.
      It will have shape (#samples, D) where the embedding dimension D is determined
      by the neural network's architecture.
      """
      self.on_predict_start()
      turn_on_off_feature_column_info(
          data_processors=self._data_processors,
          flag=True,
      )
      outputs = self.predict_per_run(
          data=data,
          realtime=realtime,
          requires_label=False,
      )
      features = extract_from_output(
          outputs=outputs,
          ret_type=COLUMN_FEATURES,
          as_ndarray=as_tensor is False,
      )
      features = self.aggregate_column_features(
          features=features, is_train=False
      )
      return features
  
imports: import logging
  import os
  import pickle
  from datetime import timedelta
  from typing import Dict, List, Optional, Union
  import lightning.pytorch
  import numpy
  import pandas
  import torch
  from omegaconf import DictConfig
  from sklearn.pipeline import Pipeline, make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.svm import SVC
  from torch import nn
  from autogluon.core.metrics import Scorer
  from autogluon.core.utils.loaders import load_pd
  from ..constants import CLIP, COLUMN_FEATURES, HF_TEXT, TIMM_IMAGE, Y_PRED, Y_TRUE
  from ..data import BaseDataModule, MultiModalFeaturePreprocessor
  from ..utils import CustomUnpickler, LogFilter, apply_log_filter, compute_score, data_to_df, extract_from_output, get_available_devices, logits_to_prob, select_model, turn_on_off_feature_column_info
  from .base import BaseLearner
label_desc: Use image node_id 17 for calling the FewShotSVMLearner obj's underlying member method code with example usage: obj.extract_embedding(data, realtime, as_tensor, as_pandas) and returns: features