System-Aware Algorithms For Machine Learning