0
$\begingroup$
X_train, X_test, y_train, y_test = train_test_split(X, y_binary_imbalanced, random_state=0)
y_scores_lr = lr.fit(X_train, y_train).decision_function(X_test)
precision, recall, thresholds = precision_recall_curve(y_test, y_scores_lr)

How does decision_function scores help calculate the thresholds in the above examples ?

$\endgroup$
0
$\begingroup$

Decision function is the output of your model--a vector with an entry for each case in X, the input. The thresholds are different numbers along the line min(output) to max(output). Eg if decision function returns 10,10,3,0,-3. You might get thresholds 11, 9, 7, 5, 3, 1, -2, -4

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.