Applications of Discrepancy Theory to Machine Learning