Machine learning for flash caching in bulk storage systems