That should probably go in sklearn.utils.extmath and loose its leading underscore.