def METHOD_NAME(model, x, y, metric, ml_phase, log_head):
    y_pred = model.predict(x)
    if len(y_pred.shape) == 1:
        y_pred = y_pred.reshape((-1,1))
    if metric == 'mse':
        result = py4ml.utils.util.METHOD_NAME(y, y_pred)
    elif metric == 'all':
        result = {'phase': ml_phase}
        result.update(py4ml.utils.util.METHOD_NAME(y, y_pred))
        return result, y_pred
    else: # accuracy
        result = {'accuracy': sklearn.metrics.accuracy_score(y, y_pred)}
    logging.info('%s %s result=%s', log_head, ml_phase, result)
    return result