mlpy.mdp.continuous.casml.CASML

class mlpy.mdp.continuous.casml.CASML(case_template, rho=None, tau=None, sigma=None, ncomponents=1, revision_method_params=None, retention_method_params=None, case_base_params=None, hmm_params=None, proba_calc_method=None)[source]

Bases: mlpy.mdp.IMDPModel

Continuous Action and State Model Learner (CASML).

Parameters:

case_template : dict

The template from which to create a new case.

Example:

An example template for a feature named state with the specified feature parameters. data is the data from which to extract the case from. In this example it is expected that data has a member variable state.

{
    "state": {
        "type": "float",
        "value": "data.state",
        "is_index": True,
        "retrieval_method": "radius-n",
        "retrieval_method_params": 0.01
    },
    "delta_state": {
        "type": "float",
        "value": "data.next_state - data.state",
        "is_index": False,
    }
}

rho : float, optional

The maximum permitted error when comparing cosine similarity of actions. Default is 0.99.

tau : float, optional

The maximum permitted error when comparing most similar solution. Default is 0.8.

sigma : float, optional

The maximum permitted error when comparing actual with estimated transitions. Default is 0.2.

ncomponents : int, optional

Number of states of the hidden Markov model. Default is 1.

revision_method_params : dict, optional

Additional initialization parameters for CASMLRevisionMethod.

retention_method_params : dict, optional

Additional initialization parameters for CASMLRetentionMethod.

case_base_params : dict, optional

Initialization parameters for CaseBase.

hmm_params : dict, optional

Additional initialization parameters for GaussianHMM.

proba_calc_method : str, optional

The method used to calculate the probability distribution for the initial states. Default is DefaultProbaCalcMethod.

Attributes

mid The module’s unique identifier.

Methods

fit(obs, actions[, n_init]) Fit the CaseBase and the HMM.
load(filename) Load the state of the module from file.
predict_proba(state, action) Predict the probability distribution.
sample([state, action]) Sample from the probability distribution.
save(filename) Save the current state of the module to file.
update(experience) Update the model with the agent’s experience.