code: def test_hummingbird_conversion_category(
      vocab_size, tmpdir, local_backend
  ):
      """Verify that Hummingbird conversion predictions match LightGBM predictions for categorical outputs."""
      input_features = [
          number_feature(),
          category_feature(encoder={"reduce_output": "sum"}),
      ]
      output_features = [
          category_feature(decoder={"vocab_size": vocab_size})
      ]
  
      # Train a model and predict using the LightGBM interface
      preds_lgbm, model = _train_and_predict_gbm(
          input_features, output_features, tmpdir, local_backend
      )
      output_feature = next(iter(model.model.output_features.values()))
      output_feature_name = f"{output_feature.column}_probabilities"
      probs_lgbm = np.stack(preds_lgbm[output_feature_name].to_numpy())
  
      # Predict using the Hummingbird compiled model
      with model.model.compile():
          preds_hb, _ = model.predict(
              dataset=os.path.join(tmpdir, "training.csv"), split="test"
          )
          probs_hb = np.stack(preds_hb[output_feature_name].to_numpy())
  
      # sanity check Hummingbird probabilities equal to LightGBM probabilities
      assert np.allclose(probs_hb, probs_lgbm, rtol=1e-6, atol=1e-6)
  
imports: import os
  import numpy
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.constants import INPUT_FEATURES, MODEL_TYPE, OUTPUT_FEATURES, TRAINER
  from ludwig.error import ConfigValidationError
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests import synthetic_test_data
  from tests.integration_tests.utils import binary_feature
  from tests.integration_tests.utils import category_feature
  from tests.integration_tests.utils import generate_data, number_feature, text_feature
label_desc: Use image node_id 20 for calling a global function with example usage: test_hummingbird_conversion_category(vocab_size, tmpdir, local_backend) without return types