Matrices, Optimization, and Randomness with Applications in Data Science