def select_threshold(model=None, data=None, curve=None, FPR=None, FNR=None, thread_count=(- 1)):
    '\n    Selects a threshold for prediction.\n\n    Parameters\n    ----------\n    model : catboost.CatBoost\n        The trained model.\n\n    data : catboost.Pool or list of catboost.Pool\n        Set of samples to build ROC curve with.\n        If set, curve parameter must not be set.\n\n    curve : tuple of three arrays (fpr, tpr, thresholds)\n        ROC curve points in format of get_roc_curve returned value.\n        If set, data parameter must not be set.\n\n    FPR : desired false-positive rate\n\n    FNR : desired false-negative rate (only one of FPR and FNR should be chosen)\n\n    thread_count : int (default=-1)\n        Number of threads to work with.\n        If -1, then the number of threads is set to the number of cores.\n\n    Returns\n    -------\n    threshold : double\n    '
    if (data is not None):
        if (curve is not None):
            raise CatboostError('Only one of the parameters data and curve should be set.')
        if (model is None):
            raise CatboostError('model and data parameters should be set when curve parameter is None.')
        if (type(data) == Pool):
            data = [data]
        if (not isinstance(data, list)):
            raise CatboostError('data must be a catboost.Pool or list of pools.')
        for pool in data:
            if (not isinstance(pool, Pool)):
                raise CatboostError('one of data pools is not catboost.Pool')
    elif (curve is not None):
        if ((not (isinstance(curve, list) or isinstance(curve, tuple))) or (len(curve) != 3)):
            raise CatboostError('curve must be list or tuple of three arrays (fpr, tpr, thresholds).')
    else:
        raise CatboostError('One of the parameters data and curve should be set.')
    return _select_threshold(model._object, data, curve, FPR, FNR, thread_count)
Selects a threshold for prediction.

Parameters
----------
model : catboost.CatBoost
    The trained model.

data : catboost.Pool or list of catboost.Pool
    Set of samples to build ROC curve with.
    If set, curve parameter must not be set.

curve : tuple of three arrays (fpr, tpr, thresholds)
    ROC curve points in format of get_roc_curve returned value.
    If set, data parameter must not be set.

FPR : desired false-positive rate

FNR : desired false-negative rate (only one of FPR and FNR should be chosen)

thread_count : int (default=-1)
    Number of threads to work with.
    If -1, then the number of threads is set to the number of cores.

Returns
-------
threshold : double
def select_threshold(model=None, data=None, curve=None, FPR=None, FNR=None, thread_count=(- 1)):
    '\n    Selects a threshold for prediction.\n\n    Parameters\n    ----------\n    model : catboost.CatBoost\n        The trained model.\n\n    data : catboost.Pool or list of catboost.Pool\n        Set of samples to build ROC curve with.\n        If set, curve parameter must not be set.\n\n    curve : tuple of three arrays (fpr, tpr, thresholds)\n        ROC curve points in format of get_roc_curve returned value.\n        If set, data parameter must not be set.\n\n    FPR : desired false-positive rate\n\n    FNR : desired false-negative rate (only one of FPR and FNR should be chosen)\n\n    thread_count : int (default=-1)\n        Number of threads to work with.\n        If -1, then the number of threads is set to the number of cores.\n\n    Returns\n    -------\n    threshold : double\n    '
    if (data is not None):
        if (curve is not None):
            raise CatboostError('Only one of the parameters data and curve should be set.')
        if (model is None):
            raise CatboostError('model and data parameters should be set when curve parameter is None.')
        if (type(data) == Pool):
            data = [data]
        if (not isinstance(data, list)):
            raise CatboostError('data must be a catboost.Pool or list of pools.')
        for pool in data:
            if (not isinstance(pool, Pool)):
                raise CatboostError('one of data pools is not catboost.Pool')
    elif (curve is not None):
        if ((not (isinstance(curve, list) or isinstance(curve, tuple))) or (len(curve) != 3)):
            raise CatboostError('curve must be list or tuple of three arrays (fpr, tpr, thresholds).')
    else:
        raise CatboostError('One of the parameters data and curve should be set.')
    return _select_threshold(model._object, data, curve, FPR, FNR, thread_count)