<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def confusion_matrix(df, col_true=None, col_pred=None):
 """ 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: """

    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]