WRITE · TRACE · UNDERSTAND
Measure binned drift with smoothing and fixed boundaries
Implement psi(reference,current,epsilon=1e-6) for equal nonempty nonnegative finite bin counts with positive totals.
Read lesson: Measure binned drift with smoothing and fixed boundaries →
Your experiment
Implement psi(reference,current,epsilon=1e-6) for equal nonempty nonnegative finite bin counts with positive totals. Add epsilon to every bin count before normalizing each histogram; return sum((q-p)*log(q/p)). Require finite epsilon>0.
Python runs in your browser. Your draft stays on this device.
What to look for
Smoothing reduces instability but changes the estimate, especially on tiny windows. PSI thresholds are not universal laws; calibrate alerts against reference variation and observed model outcomes.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
