def _infer_n_folds(cv_results):
    """
    Gets the number of CV folds from a cv_results object

    Parameters
    ----------
    cv_results: dict
        The cv results.

    Output
    ------
    cv: int
        The number of cv folds
    """
    split_keys = [k for k in cv_results.keys()
                  if k.split('_')[0][0:5] == 'split']
    split_idxs = [int(k.split('_')[0].split('split')[1]) for k in split_keys]
    return max(split_idxs) + 1