class_docstr: Integration with the AutoKeras ML library.
class_docstr_tok: ["Integration","with","the","AutoKeras","ML","library","."]
docstr: Predicts with best saved AutoKeras model.
docstr_tok: ["Predicts","with","best","saved","AutoKeras","model","."]
code: def predict(self, df, args=None):
      """Predicts with best saved AutoKeras model."""
      args = self.model_storage.json_get("predict_args")
      training_df = pd.read_json(args["training_df"])
      model = load_model(
          args["folder_path"], custom_objects=ak.CUSTOM_OBJECTS
      )
  
      df_to_predict = df.copy()
      predictions = get_preds_from_model(
          df_to_predict,
          model,
          args["target"],
          args["training_data_column_count"],
          args["data_column_names"],
      )
  
      # If we used the classifier we need to pre-process the predictions before returning them
      original_y = training_df[args["target"]]
      if not np.issubdtype(original_y.dtype, np.number):
          return format_categorical_preds(
              predictions, original_y, df_to_predict, args["target"]
          )
  
      df_to_predict[args["target"]] = predictions
      return df_to_predict
  
file_path: mindsdb/mindsdb/integrations/handlers/autokeras_handler/autokeras_handler.py
imports: import os
  import random
  import string
  from typing import Optional
  import numpy
  import pandas
  import autokeras
  from sklearn import preprocessing
  from tensorflow.keras.models import load_model
  from mindsdb.integrations.libs.base import BaseMLEngine
label_desc: Use image node_id 2 for calling the AutokerasHandler obj's underlying member method code with example usage: obj.predict(df, args) and returns: df_to_predict, format_categorical_preds