def _get_scores(model, feat):
    """Get the scores from a model

    We want to use the `decision_function` method if it is available,
    but fall back to the `predict_proba` method if it isn't. In sklearn,
    `predict_proba` for a binary classifier returns a two-column numpy array,
    where the second column is the probability we want. However,
    skorch (and other tools) sometime do this differently, returning only
    a single column. This function makes it so mokapot can work with either.

    Parameters
    ----------
    model : an estimator object
        The model to score the PSMs.
    feat : np.ndarray
        The normalized features

    Returns
    -------
    np.ndarray
        A :py:class:`numpy.ndarray` containing the score for each PSM in feat.
    """
    try:
        return model.decision_function(feat)
    except AttributeError:
        scores = model.predict_proba(feat).squeeze()
        if len(scores.shape) == 2:
            return model.predict_proba(feat)[:, 1]
        elif len(scores.shape) == 1:
            return scores
        else:
            raise RuntimeError("'predict_proba' returned too many dimensions.")