Is the risk score working?

HardPayPalntileprecision and recallvalues liststhresholdscorrelation· 160 XP (40 per step)

Mock interview. You're interviewing for a senior risk data scientist job on a payments team. The interviewer says: "Every payment gets a risk_score from 0 to 1 from a model built years ago. We're about to start blocking high-score payments. Tell me if the score actually works."

For this interview, a payment is bad if it was refunded or failed. A good risk score should give bad payments higher scores.

Step 1: Bad rate by score band

"Split all payments into 10 equal bands by risk_score (1 = lowest scores). Show each band's payments, its score range and its bad rate."

Expected output

  • Columns band, payments, min_score, max_score, bad_rate (a percentage rounded to 1 decimal); sorted by band

Example of the shape (made-up values):

band payments min_score max_score bad_rate
1 250 0.000 0.010 4.0

Hints, the later steps and the answer come with Pro.

Step 1 of 4

Write your query here. Ctrl + Enter submits.