We have this function in `sklearn.metrics` now. Please reuse it if possible.