code: def test_eval_data_having_new_categories(self):
      train_data = pd.DataFrame(
          data=[[1, 2, 0], [2, 3, 1], [3, 3, 0]],
          columns=["c1", "c2", "target"],
      )
      test_data = pd.DataFrame(
          data=[[1, 1, 0]], columns=["c1", "c2", "target"]
      )
  
      X_train = train_data.drop(["target"], axis=1)
      y_train = train_data["target"]
      model = create_lightgbm_classifier(X_train, y_train)
  
      model_analysis = ModelAnalysis(
          model=model,
          train=train_data,
          test=test_data,
          target_column="target",
          task_type="classification",
          categorical_features=["c2"],
      )
  
      message = (
          "Counterfactual example generation requires "
          "that every category of "
          "categorical features present in the test data be "
          "also present in the train data. "
          "Categories missing from train data: "
          "{'c2': \\[1\\]}"
      )
      with pytest.raises(UserConfigValidationException, match=message):
          model_analysis.counterfactual.add(
              total_CFs=10, method="random", desired_class="opposite"
          )
  
imports: import logging
  from unittest.mock import MagicMock
  import pandas
  import pytest
  from tests.common_utils import create_iris_data
  from rai_test_utils.datasets.tabular import create_binary_classification_dataset, create_cancer_data, create_housing_data
  from rai_test_utils.models.lightgbm import create_lightgbm_classifier
  from rai_test_utils.models.sklearn import create_sklearn_random_forest_regressor
  from raiutils.exceptions import UserConfigValidationException
  from responsibleai.modelanalysis.model_analysis import ModelAnalysis
label_desc: Use image node_id 7 for calling the TestCounterfactualUserConfigValidations obj's underlying member method code with example usage: obj.test_eval_data_having_new_categories() without return types