The best model I ever built
I once built a statistical prediction model with , and in $HOWEVER_MANY years of doing this stuff that remains the most predictive model I have ever built. The story is perhaps instructive. One of the Folks From The Other Functions turned up with a dataset, a binary patient outcome, and A Bunch Of Data from a new assay they were testing out. Being young, stupid, and helpful I of course engaged with this problem, and I was of course clever enough to talk The Stakeholder through the problem and filter the dataset down to the pre-outcome data. And I knew of course that you don’t do clever stuff like oversampling because you’ve got to deal with the patient cohort in front of you rather than the one you want. Go me.
Feeling slightly proud of myself I built the model (ISTR it was gradient boosting). And it worked. It worked almost perfectly. And whilst I was young and stupid I wasn’t quite that young and stupid and fortunately did not go back to colleague-from-other-function with “we can do this perfectly”. When anything works better than it has any right to you first suspect that you have enthusiastically kicked yourself in the anatomy and fouled up your coding. But, no, coding perfect.
Next step. What’s the actual data?1 Plot it out, take a look, see what’s going on. And it was curious. About half the data seemed to saturate at a lower limit of about , the other half went down to 2. Well that’s a bit odd.
And what’s more, the upper half of the data all had , the lower half all had . So this is now something I need to talk to colleague-from-other-function about. So I did. It went something like this.
| your hero | Hi — I’ve noticed this weird thing in the data, take a look at this plot. |
| CFOF | What’s going on here? |
| your hero | Well, you see <insert explanation here> |
| CFOF | That’s what I expected — we tested the patients-with-outcome with v1 of the assay and then when we saw it did something we went and tested the patients-without-outcome with v2, which has LLoQ 10 times smaller. |
| your hero3 | Ah, I see. That actually matters quite a bit. |
Your hero then goes away, artificially censors the v2 data, and refits the model. The phrase “coin toss” is appropriate at this stage of the discussion.
But, I once built a perfect model.