code: def test_categorical(self):
      # Arrange
      sf = tc.SFrame(
          {
              "cat1": ["1", "1", "2", "2", "2"] * 100,
              "cat2": ["1", "3", "3", "1", "1"] * 100,
              "target": ["1", "2", "1", "2", "1"] * 100,
          }
      )
  
      # Act
      tree = _make_tree(sf)
      root = tree.root
  
      # Check the root node.
      self.assertEqual(len(tree.nodes), 7)
      self.assertEqual(
          root.to_dict(),
          {
              "is_leaf": False,
              "left_id": 2,
              "node_id": 0,
              "missing_id": 1,
              "node_type": "indicator",
              "parent_id": None,
              "right_id": 1,
              "split_feature_column": "cat1",
              "split_feature_index": "1",
              "value": 1,
          },
      )
  
      # Check prediction paths.
      self.assertEqual(tree.get_prediction_path(0), [])
      self.assertEqual(
          tree.get_prediction_path(1),
          [
              {
                  "child_id": 1,
                  "feature": "cat1",
                  "index": "1",
                  "node_type": "indicator",
                  "node_id": 0,
                  "sign": "!=",
                  "value": 1,
                  "is_missing": False,
              }
          ],
      )
      self.assertEqual(
          tree.get_prediction_path(2),
          [
              {
                  "child_id": 2,
                  "feature": "cat1",
                  "index": "1",
                  "node_id": 0,
                  "sign": "=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              }
          ],
      )
      self.assertEqual(
          tree.get_prediction_path(3),
          [
              {
                  "child_id": 1,
                  "feature": "cat1",
                  "index": "1",
                  "node_id": 0,
                  "sign": "!=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
              {
                  "child_id": 3,
                  "feature": "cat2",
                  "index": "1",
                  "node_id": 1,
                  "sign": "!=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
          ],
      )
      self.assertEqual(
          tree.get_prediction_path(4),
          [
              {
                  "child_id": 1,
                  "feature": "cat1",
                  "index": "1",
                  "node_id": 0,
                  "sign": "!=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
              {
                  "child_id": 4,
                  "feature": "cat2",
                  "index": "1",
                  "node_id": 1,
                  "sign": "=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
          ],
      )
      self.assertEqual(
          tree.get_prediction_path(5),
          [
              {
                  "child_id": 2,
                  "feature": "cat1",
                  "index": "1",
                  "node_id": 0,
                  "sign": "=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
              {
                  "child_id": 5,
                  "feature": "cat2",
                  "index": "1",
                  "node_id": 2,
                  "sign": "!=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
          ],
      )
      self.assertEqual(
          tree.get_prediction_path(6),
          [
              {
                  "child_id": 2,
                  "feature": "cat1",
                  "index": "1",
                  "node_id": 0,
                  "sign": "=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
              {
                  "child_id": 6,
                  "feature": "cat2",
                  "index": "1",
                  "node_id": 2,
                  "sign": "=",
                  "value": 1,
                  "node_type": "indicator",
                  "is_missing": False,
              },
          ],
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  from turicreate.toolkits._decision_tree import DecisionTree, Node
  from turicreate.toolkits._main import ToolkitError
label_desc: Use image node_id 1 for calling the PythonDecisionTreeCorrectness obj's underlying member method code with example usage: obj.test_categorical() without return types