code: def test_embedding_transformer(regression_data):
      (train, test, target) = regression_data
      data_config = DataConfig(
          target=target,
          continuous_cols=[
              "AveRooms",
              "AveBedrms",
              "Population",
              "AveOccup",
              "Latitude",
              "Longitude",
          ],
          categorical_cols=["HouseAgeBin"],
      )
      model_config_params = {"task": "regression"}
      model_config = CategoryEmbeddingModelConfig(**model_config_params)
      trainer_config = TrainerConfig(
          max_epochs=1,
          checkpoints=None,
          early_stopping=None,
          accelerator="cpu",
          fast_dev_run=True,
      )
      optimizer_config = OptimizerConfig()
  
      tabular_model = TabularModel(
          data_config=data_config,
          model_config=model_config,
          optimizer_config=optimizer_config,
          trainer_config=trainer_config,
      )
      tabular_model.fit(train=train)
  
      transformer = CategoricalEmbeddingTransformer(tabular_model)
      train_transform = transformer.fit_transform(train)
      embed_cols = [
          col
          for col in train_transform.columns
          if "HouseAgeBin_embed_dim" in col
      ]
      assert len(train["HouseAgeBin"].unique()) + 1 == len(
          transformer._mapping["HouseAgeBin"].keys()
      )
      assert all(
          val.shape[0] == len(embed_cols)
          for val in transformer._mapping["HouseAgeBin"].values()
      )
  
file_path: pytorch_tabular/tests/test_categorical_embedding.py
imports: import numpy
  import pytest
  import torch
  from pytorch_tabular import TabularModel
  from pytorch_tabular.categorical_encoders import CategoricalEmbeddingTransformer
  from pytorch_tabular.config import DataConfig, OptimizerConfig, TrainerConfig
  from pytorch_tabular.models import CategoryEmbeddingModelConfig
  from sklearn.preprocessing import PowerTransformer
label_desc: Use image node_id 4 for calling a global function with example usage: test_embedding_transformer(regression_data) without return types