def parse_method(name):
    """Parse hyperparameters from string name to make legend label.

    Parameters
    ----------
    name : str
        Name of method

    Returns
    -------
    string : str
        Formatted string
    """
    string = r""
    if name.split('es_')[1][0] == '1':
        string += r'ES'
    if name.split('vm_')[1][0] == '1':
        if len(string) > 0: 
            string += r', VM'
        else:
            string += r'VM'
    alpha = name.split('alpha_')[1].split('_')[0]
    if len(string) > 0: 
        string += r', $\alpha=%s$' % alpha
    else:
        string += r'$\alpha=%s$' % alpha
    return string