adapted AbstractLearner.py