get_fnr_curve

Return points of the FNR curve.

Method call format

get_fnr_curve(model=None,
              data=None,
              curve=None,
              thread_count=-1)

Parameters

ParameterPossible typesDescriptionDefault value
modelcatboost.CatBoostThe trained model.None
data
  • catboost.Pool
  • list of catboost.Pool

A set of samples to build the FNR curve with.

Should not be used with the curve parameter.

None
curvetuple of three arrays (fpr, tpr, thresholds)

ROC curve points.

Should not be used with the data parameter.

Required if the data and model parameters are set to None.

It is strictly recommended to use the output of the get_roc_curve function as the value of this parameter.

The input data must meet the following criteria:
  • The threshold values should not increase.
  • There should not be any repetitions of the fpr-tpr- threshold triplets.
None
thread_countint

The number of threads to use.

Optimizes the speed of execution. This parameter doesn't affect results.

-1 (the number of threads is equal to the number of cores)

Type of return value

tuple of two arrays (thresholds, fnr)

Usage examples

from catboost import CatBoostClassifier, Pool
from catboost.utils import get_roc_curve, get_fnr_curve

train_data = [[1,3],
              [0,4],
              [1,7],
              [3,0]]
train_labels = [1,0,1,1]
catboost_pool = Pool(train_data, train_labels)
model = CatBoostClassifier(learning_rate=0.03)
model.fit(train_data, train_labels, verbose=False)
roc_curve_values = get_roc_curve(model, catboost_pool)
(thresholds, fnr) = get_fnr_curve(curve=roc_curve_values)
print thresholds
print fnr

Output:

[1.         0.54411915 0.50344403 0.        ]
[1.         0.33333333 0.         0.        ]