code: def confusion_matrix(df, col_true=None, col_pred=None):
      
      if not col_pred:
          col_pred = get_field_name_by_role(df, FieldRole.PREDICTED_CLASS)
      return _run_cm_node(df, col_true, col_pred)[0]
docs: Compute confusion matrix of a predicted DataFrame.
  
      Note that this method will trigger the defined flow to execute.
  
      :param df: predicted data frame
      :type df: DataFrame
      :param col_true: column name of true label
      :type col_true: str
      :param col_true: column name of predicted label, 'prediction_result' by default.
      :type col_pred: str
      :return: Confusion matrix and mapping list for classes
  
      :Example:
  
      >>> predicted = model.predict(input_data)
      >>> cm, mapping = confusion_matrix(predicted, 'category')