def stability_selection_to_threshold(stability_selection, n_boots):
    """Converts user inputted stability selection to an array of
    thresholds. These thresholds correspond to the number of bootstraps
    that a feature must appear in to guarantee placement in the selection
    profile.

    Parameters
    ----------
    stability_selection : int, float, or array-like
        If int, treated as the number of bootstraps that a feature must
        appear in to guarantee placement in selection profile. If float,
        must be between 0 and 1, and is instead the proportion of
        bootstraps.

    n_boots: int
        The number of bootstraps that will be used for selection
    """
    if isinstance(stability_selection, float):
        selection_threshold = int(stability_selection * n_boots)
    elif isinstance(stability_selection, int):
        selection_threshold = stability_selection
    else:
        raise ValueError('Stability selection must be a valid float or int.')
    if not (selection_threshold <= n_boots and selection_threshold >= 1):
        raise ValueError(
            'Stability selection thresholds must be within the correct bounds.'
            )
    return selection_threshold
