mlpy.learners.LearnerFactory.create

static LearnerFactory.create(_type, *args, **kwargs)[source]

Create an learner of the given type.

A new learner of the given type is created. If progress is among the keywords in kwargs, the factory attempts to recover the learner from the learner state saved to file filename. If the factory fails to load the learners state from file, a new learner is created.

Parameters:

_type : str

The learner type. Valid learner types:

qlearner

Performs q-learning, a reinforcement learning variant. A QLearner module is created.

rldtlearner

The learner performs reinforcement learning with decision trees (RLDT), a method introduced by Hester, Quinlan, and Stone which builds a generalized model for the transitions and rewards of the environment. A RLDTLearner module is created.

apprenticeshiplearner

The learner performs apprenticeship learning via inverse reinforcement learning, a method introduced by Abbeel and Ng which strives to imitate the demonstrations given by an expert. A ApprenticeshipLearner module is create.

incrapprenticeshiplearner

The learner incrementally performs apprenticeship learning via inverse reinforcement learning. Inverse reinforcement learning assumes knowledge of the underlying model. However, this is not always feasible. The incremental apprenticeship learner updates its model after every iteration by executing the current policy. A IncrApprenticeshipLearner module is create.

args : tuple, optional

Positional arguments passed to the class of the given type for initialization.

kwargs : dict, optional

Non-positional arguments passed to the class of the given type for initialization.

Returns:

ILearner :

A learner instance of the given type.