docstr: Test data with size smaller than number of categories.
docstr_tok: ["Test","data","with","size","smaller","than","number","of","categories","."]
code: def run_max_cat(self, tree_method: str) -> None:
      """Test data with size smaller than number of categories."""
      import pandas as pd
  
      rng = np.random.default_rng(0)
      n_cat = 100
      n = 5
  
      X = pd.Series(
          [
              "".join(rng.choice(list(ascii_lowercase), size=3))
              for i in range(n_cat)
          ],
          dtype="category",
      )[:n].to_frame()
  
      reg = xgb.XGBRegressor(
          enable_categorical=True,
          tree_method=tree_method,
          n_estimators=10,
      )
      y = pd.Series(range(n))
      reg.fit(X=X, y=y, eval_set=[(X, y)])
      assert tm.non_increasing(
          reg.evals_result()["validation_0"]["rmse"]
      )
  
imports: import json
  from string import ascii_lowercase
  from typing import Any, Dict
  import numpy
  import pytest
  from hypothesis import given, note, settings, strategies
  import xgboost
  from xgboost import testing
  from xgboost.testing.params import cat_parameter_strategy, exact_parameter_strategy, hist_cache_strategy, hist_parameter_strategy
  from xgboost.testing.updater import check_categorical_missing, check_categorical_ohe, check_get_quantile_cut, check_init_estimation, check_quantile_loss, train_result
label_desc: Use image node_id 10 for calling the TestTreeMethod obj's underlying member method code with example usage: obj.run_max_cat(tree_method) without return types