def _get_target_columns(metadata):
    """Given ModelPipeline metadata, construct the list of columns output by
    the model's prediction method.
    """
    target_cols = []
    if metadata['model']['type'] == 'classification':
        # Deal with multilabel models, if necessary
        if len(metadata['data']['target_columns']) > 1:
            for i, col in enumerate(metadata['data']['target_columns']):
                for cls in metadata['data']['class_names'][i]:
                    target_cols.append(col + '_' + str(cls))
        else:
            col = metadata['data']['target_columns'][0]
            for cls in metadata['data']['class_names']:
                target_cols.append(col + '_' + str(cls))
    else:
        for col in metadata['data']['target_columns']:
            target_cols.append(col)

    return target_cols