Machine Learning Foundations: A Case Study Approach