Scaling Machine Learning via Prioritized Optimization