Add basic caching for classifiers