code: def test_format_categorical_preds():
      """Tests helper function to put categorical predictions into the right format"""
      predictions = np.array([[0.9, 0.05, 0.05], [0, 1, 0], [0, 0, 1]])
      original_y = pd.Series(["a", "b", "c"])
      keras_output_df = pd.DataFrame({"target": predictions.tolist()})
      formatted_df = format_categorical_preds(
          predictions, original_y, keras_output_df, "target"
      )
      assert formatted_df["target"].tolist() == ["a", "b", "c"]
      assert formatted_df["confidence"].tolist() == [
          max(row) for row in predictions
      ]
  
file_path: mindsdb/tests/unit/ml_handlers/test_autokeras.py
imports: import time
  from unittest.mock import patch
  import pandas
  import numpy
  from mindsdb_sql import parse_sql
  from mindsdb.integrations.handlers.autokeras_handler.autokeras_handler import format_categorical_preds
  from tests.unit.executor_test_base import BaseExecutorTest
label_desc: Use image node_id 1 for calling a global function with example usage: test_format_categorical_preds() without return types