Caching in Machine Learning