def agg_loss(method):
    """
    Extract aggregate loss from full name of method.

    Args:
        method (str): full name of method

    Returns:
        str: aggregate loss
    """
    if method[:6] == "hinge_":
        return method[6:]
    if method[:9] == "logistic_":
        return method[9:]
    if method[:7] == "sklearn":
        return method[7:]