The table
Use one row per account per month-end. Each row holds the values as they stood on that date.collections.csv
- The row answer,
recovered_next_month_pct, is the amount recovered during the month after the row, as a share of the original amount due. It is known at the end of that next month. - The group answer,
total_recovered_pct, is the account’s total recovery as a share of the original amount due. It is known once the account is closed, by full payment, settlement or write-off. It is empty while the account is open.
Fit and predict
- the predicted recovery in the next month, with quantiles;
- the predicted total recovery of the account, as of that month, with quantiles, under
group.
last_call_note is read as text. If the fit report shows it as a category, which can happen when the notes are short and repetitive, set its type with column_types={"last_call_note": "text"}. If you also have transcripts of recorded calls, add them as another text column. The model reads each one as a few numeric columns, computed from the context’s texts only.
Keep the total above what is already recovered
The total recovery of an account cannot be lower than what the account has already paid. The model is not given this as a rule. Apply it to the predicted total after the call, with the amount recovered to date as a floor.Backtest on a past month
To see how the model would have done at the end of July, stand at that date withas_of.
Things that often go wrong
- Statuses written over. A collections system often keeps one current status per account, such as “settled” or “legal”. On an old row it shows today’s status, which is the answer. Take statuses from a monthly history.
- Payments dated by posting. A payment posted on the 2nd for the previous month belongs to that previous month’s answer. Date it by when it was paid, and make sure it falls into the right month’s row.
- Closed accounts with open months. An account closed in July should have no rows after July. Rows after the close make the model read a closed account as if it were still open.