@classmethod
def parse(cls, pattern):
    """
        Parse a formatted string representing a threshold optimization. E.g.
        'maximum recall @ precision >= 0.9' or
        'minimum match_rate @ recall >= 0.9'.

        :Parameters:
            pattern : `str`
                The optimization pattern to parse
        """
    match = cls.STRING_PATTERN.match(pattern.strip().lower())
    if match is None:
        raise ValueError('{0!r} does not match optimization pattern: '.
            format(pattern) + '"(maximum|minimum) <target> @ ' +
            '<cond> (>=|<=) [float]"')
    maximize, target, _, cond, _, greater, cond_value, _ = match.groups()
    return cls(maximize == 'maximum', target, cond, greater == '>=', float(
        cond_value))
