frankg1401
frankg1401

Reputation: 33

ROC and continuous values

So I used GradientBoostingRegressor to predict a target from a number of variables. The target is whole numbers from 0 to 27. The GradientBoostingRegressor returns y_pred_gb = reg.predict(input_test), which are also whole numbers from 0 to 27.

Then, I manually set a cutoff of 10, and convert both y_pred_gb and y_test (ground truth) to Booleans y_pred_gb_binary and y_test_binary (above 10 as positive (1), otherwise negative (0)). Thus, I have converted it to a classification problem.

How should I generate ROC curve in this case? I used this code fpr, tpr, _ = roc_curve(y_test_binary, y_pred_gb). My question: Can I use y_pred_gb as the second input to roc_curve? Documentation says this should be "Target scores, can either be probability estimates of the positive class, confidence values, or non-thresholded measure of decisions (as returned by “decision_function” on some classifiers)". How can I get the target scores?

It does generate a ROC curve for me, but the curve is very similar between different manual cutoffs, even though the accuracy increases dramatically when the manual cutoff increases. Why?

Thank you!

Upvotes: 0

Views: 23

Answers (0)

Related Questions