code: def test_lpi_with_categorical_data():
      """Verify LPI can be computed on categorical dimensions"""
      data = pd.DataFrame(
          data={
              "id": ["a", "b", "c", "d"],
              "x": [0, 1, 2, 3],
              "y": ["b", "c", "a", "d"],
              "objective": [0.1, 0.2, 0.3, 0.5],
          }
      )
  
      space = SpaceBuilder().build(
          {"x": "uniform(0, 6)", "y": 'choices(["a", "b", "c", "d"])'}
      )
  
      results = lpi(data, space, random_state=1)
      assert results.columns.tolist() == ["LPI", "STD"]
      assert results.index.tolist() == ["x", "y"]
      # The data is made such that x correlates more strongly with objective than y
      assert results["LPI"].loc["x"] > results["LPI"].loc["y"]
  
file_path: orion/tests/unittests/analysis/test_lpi.py
imports: import copy
  import numpy
  import pandas
  from orion.analysis.base import to_numpy, train_regressor
  from orion.analysis.lpi_utils import compute_variances, lpi, make_grid
  from orion.core.io.space_builder import SpaceBuilder
label_desc: Use image node_id 7 for calling a global function with example usage: test_lpi_with_categorical_data() without return types