maxProb¶
-
model.decision.discrete.maxProb(task_responses=(0, 1))[source]¶ Decisions for an arbitrary number of choices
Choice made by choosing the most likely
Parameters: task_responses (tuple) – Provides the action responses expected by the tasks for each probability estimate. Returns: - decision_function (function) – Calculates the decisions based on the probabilities and returns the decision and the probability of that decision
- decision (int or None) – The action to be taken by the model
- probDict (OrderedDict of valid responses) – A dictionary of considered actions as keys and their associated probabilities as values
See also
models.QLearn(),models.QLearn2(),models.OpAL()Examples
>>> np.random.seed(100) >>> d = maxProb([1,2,3]) >>> d([0.6, 0.3, 0.5]) (1, OrderedDict([(1, 0.6), (2, 0.3), (3, 0.5)])) >>> d([0.2, 0.3, 0.5], trial_responses=[1, 2]) (2, OrderedDict([(1, 0.2), (2, 0.3), (3, 0.5)])) >>> d([0.2, 0.3, 0.5], trial_responses=[]) (None, OrderedDict([(1, 0.2), (2, 0.3), (3, 0.5)])) >>> d = maxProb(["A", "B", "C"]) >>> d([0.6, 0.3, 0.5], trial_responses=["A", "B"]) ('A', OrderedDict([('A', 0.6), ('B', 0.3), ('C', 0.5)]))