tasks.weather module

Author:Dominic Hunt
Reference:Probabilistic classification learning in amnesia. Knowlton, B. J., Squire, L. R., & Gluck, M. a. (1994). Learning & Memory(Cold Spring Harbor, N.Y.), 1(2), 106–120. http://doi.org/10.1101/lm.1.2.106
class tasks.weather.RewardWeatherDiff(**kwargs)[source]

Bases: model.modelTemplate.Rewards

Processes the weather reward for models expecting reward corrections

processFeedback(feedback, lastAction, stimuli)[source]
Returns:
Return type:modelFeedback
class tasks.weather.RewardWeatherDualCorrection(**kwargs)[source]

Bases: model.modelTemplate.Rewards

Processes the decks reward for models expecting the reward correction from two possible actions.

epsilon = 1
processFeedback(feedback, lastAction, stimuli)[source]
Returns:
Return type:modelFeedback
class tasks.weather.RewardsWeatherDirect(**kwargs)[source]

Bases: model.modelTemplate.Rewards

Processes the weather reward for models expecting the reward feedback

processFeedback(feedback, lastAction, stimuli)[source]
Returns:
Return type:modelFeedback
class tasks.weather.StimulusWeatherDirect(**kwargs)[source]

Bases: model.modelTemplate.Stimulus

Processes the weather stimuli for models expecting just the event

processStimulus(observation)[source]

Processes the decks stimuli for models expecting just the event

Returns:
  • stimuliPresent (int or list of int) – The elements present of the stimulus
  • stimuliActivity (float or list of float) – The activity of each of the elements
class tasks.weather.Weather(cueProbs=[[0.2, 0.8, 0.2, 0.8], [0.8, 0.2, 0.8, 0.2]], learningLen=200, testLen=100, number_cues=None, cues=None, actualities=None)[source]

Bases: tasks.taskTemplate.Task

Based on the 1994 paper “Probabilistic classification learning in amnesia.”

Many methods are inherited from the tasks.taskTemplate.Task class. Refer to its documentation for missing methods.

Name

The name of the class used when recording what has been used.

Type:string
Parameters:
  • cueProbs (array of int, optional) – If generating data, the likelihood of each cue being associated with each actuality. Each row of the array describes one actuality, with each column representing one cue. Each column is assumed sum to 1
  • number_cues (int, optional) – The number of cues
  • learningLen (int, optional) – The number of trials in the learning phase. Default is 200
  • testLen (int, optional) – The number of trials in the test phase. Default is 100
  • actualities (array of int, optional) – The actual reality the cues pointed to; the correct response the participant is trying to get correct
  • cues (array of floats, optional) – The stimulus cues used to guess the actualities
defaultCueProbs = [[0.2, 0.8, 0.2, 0.8], [0.8, 0.2, 0.8, 0.2]]
feedback()[source]

Feedback to the action from the participant

proceed()[source]

Updates the task after feedback

receiveAction(action)[source]

Receives the next action from the participant

Parameters:action (int or string) – The action taken by the model
returnTaskState()[source]

Returns all the relevant data for this task run

Returns:results – A dictionary containing the class parameters as well as the other useful data
Return type:dictionary
storeState()[source]

Stores the state of all the important variables so that they can be output later

tasks.weather.genActualities(cueProbs, cues, learningLen, testLen)[source]
Parameters:
  • cueProbs
  • cues
  • learningLen
  • testLen
Returns:

Return type:

actions

tasks.weather.genCues(number_cues, taskLen)[source]
Parameters:
  • cueProbs
  • taskLen
Returns:

Return type:

cues