machine learning foundations: a case study approach