A Near-Optimal Algorithm for Debiasing Trained Machine Learning Models