Target encoding without train-test split

Code reviewHard20 minDatabricks style

Your task

Review this Python target-encoding helper.

CV scores are excellent but live performance is poor. Diagnose it.