'Get the learner for a given problem type.
Parameters
problem_type: str or Table or Domain
If str, one of ``\'classification\'`` or ``\'regression\'``. If Table
or Domain, the type is inferred from Domain\'s first class variable.
Returns
Learner
The appropriate learner for the given problem type.
Raises
TypeError
When (inferred) problem type not one of ``\'classification\'``
or ``\'regression\'``.'

def get_learner(self, problem_type):

    if isinstance(problem_type, Table):
        problem_type = problem_type.domain
    if isinstance(problem_type, Domain):
        problem_type = (self.CLASSIFICATION if problem_type.has_discrete_class else (self.REGRESSION if problem_type.has_continuous_class else None))
    if (problem_type not in self.__fits__):
        raise TypeError("No    learner    to    handle    '{}'".format(problem_type))
    if (self.__learners[problem_type] is None):
        learner = self.__fits__[problem_type](**self.__kwargs(problem_type))
        learner.use_default_preprocessors = self.use_default_preprocessors
        self.__learners[problem_type] = learner
    return self.__learners[problem_type]
