dispel.providers.generic.tasks.cps.steps module#
Cognitive Processing Speed test related functionality.
This module contains functionality to extract measures for the Cognitive Processing Speed test.
- class dispel.providers.generic.tasks.cps.steps.AggregateFixedSubstitutionTime[source]#
Bases:
AggregateMeasures
Extract the substitution time for the fixed keys.
- static aggregation_method(values)#
Compute the substitution time.
The substitution time is defined as the difference between the symbol to digit reaction time (the time required to associate a symbol with a number) and the digit to digit reaction time (the time required to associate a number with a number).
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- fail_if_missing = False#
- measure_ids: List[DefinitionIdType] = ['cps-dtd_rand-rt-mean', 'cps-std_rand_key1-rt-mean', 'cps-std_rand_key2-rt-mean']#
- class dispel.providers.generic.tasks.cps.steps.AggregateRandomSubstitutionTime[source]#
Bases:
AggregateMeasures
Extract the substitution time for the random keys.
- static aggregation_method(values)#
Compute the substitution time.
The substitution time is defined as the difference between the symbol to digit reaction time (the time required to associate a symbol with a number) and the digit to digit reaction time (the time required to associate a number with a number).
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- fail_if_missing = False#
- measure_ids: List[DefinitionIdType] = ['cps-dtd_rand-rt-mean', 'cps-std_rand_keyr-rt-mean']#
- class dispel.providers.generic.tasks.cps.steps.CPSProcessingStepGroup[source]#
Bases:
ProcessingStepGroup
A group of all cps processing steps for measures extraction.
- class dispel.providers.generic.tasks.cps.steps.ConfusionBase[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
Confusion extract multiple steps Base.
- confusion_pair#
List of the most likely to be confused pair.
- abstract apply_pair(data, pair)[source]#
Get the measure value definition.
- Parameters:
data (DataFrame) –
pair (DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality) –
- Return type:
- confusion_pair: List[DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality]#
- data_set_ids: str | Iterable[str] = 'confusion-matrix'#
An iterable of data sets to be being processed
- function_factory(pair)[source]#
Get function factory.
- Parameters:
pair (DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality) –
- Return type:
- class dispel.providers.generic.tasks.cps.steps.ExtractAllReactionTime[source]#
Bases:
ExtractSubsetReactionTimesBase
A reaction time extraction processing step for all keys.
- subset: AV | ResponsesModality = all keys (all)#
- class dispel.providers.generic.tasks.cps.steps.ExtractCPSMeasures[source]#
Bases:
ProcessingStepGroup
Extract all measures for a given mode, sequence and key set.
- Parameters:
mode – The desired mode to compute the transformation (
digit-to-symbol
,digit-to-digit
).key_set – The specific key set filter on which you desire to extract measures.
sequence – The sequence type
- __init__(mode, sequence, key_set=None)[source]#
- Parameters:
mode (CPSMode) –
sequence (CPSSequence) –
key_set (CPSKeySet | None) –
- class dispel.providers.generic.tasks.cps.steps.ExtractCPSMeasuresDTD[source]#
Bases:
ProcessingStepGroup
Extract all measures for DTD mode, sequence and key set.
- Parameters:
sequence – The sequence type
- __init__(sequence)[source]#
- Parameters:
sequence (CPSSequence) –
- class dispel.providers.generic.tasks.cps.steps.ExtractCPSMeasuresSTD[source]#
Bases:
ProcessingStepGroup
Extract all measures for STD mode, sequence and key set.
- Parameters:
key_set – The specific key set filter on which you desire to extract measures.
sequence – The sequence type
- __init__(sequence, key_set)[source]#
- Parameters:
sequence (CPSSequence) –
key_set (CPSKeySet) –
- class dispel.providers.generic.tasks.cps.steps.ExtractCPSSteps[source]#
Bases:
ExtractStep
CPS multiple steps extraction.
- transform_functions#
An optional list of dictionaries containing at least the processing function under the key
func
- Type:
Iterable[Dict[str, Any]]
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionBase[source]#
Bases:
ConfusionBase
Confusion measures extraction mix in.
- apply_pair(data, pair)[source]#
Get apply function for ExtractSteps.
- Parameters:
pair (DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality) –
- measure_name: AV = confusion (conf)#
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionDTD[source]#
Bases:
ExtractConfusionBase
Confusion measures extraction.
- confusion_pair: List[PairType] = [DigitConfusionPairModality.DIGIT_6_9, DigitConfusionPairModality.DIGIT_9_6]#
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionDTS[source]#
Bases:
ExtractConfusionBase
Confusion measures extraction.
- confusion_pair: List[PairType] = [SymbolConfusionPairModality.SYMBOL_2_7, SymbolConfusionPairModality.SYMBOL_7_2, SymbolConfusionPairModality.SYMBOL_4_6, SymbolConfusionPairModality.SYMBOL_6_4, SymbolConfusionPairModality.SYMBOL_3_8, SymbolConfusionPairModality.SYMBOL_8_3]#
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionRateBase[source]#
Bases:
ConfusionBase
Confusion rate measures extraction mix in.
- apply_pair(data, pair)[source]#
Get apply function for ExtractSteps.
- Parameters:
pair (DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality) –
- measure_name: AV = confusion rate (confr)#
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionRateDTD[source]#
Bases:
ExtractConfusionRateBase
Confusion measures extraction for digit.
- confusion_pair: List[PairType] = [DigitConfusionPairModality.DIGIT_6_9, DigitConfusionPairModality.DIGIT_9_6]#
- class dispel.providers.generic.tasks.cps.steps.ExtractConfusionRateDTS[source]#
Bases:
ExtractConfusionRateBase
Confusion measures extraction for digit.
- confusion_pair: List[PairType] = [SymbolConfusionPairModality.SYMBOL_2_7, SymbolConfusionPairModality.SYMBOL_7_2, SymbolConfusionPairModality.SYMBOL_4_6, SymbolConfusionPairModality.SYMBOL_6_4, SymbolConfusionPairModality.SYMBOL_3_8, SymbolConfusionPairModality.SYMBOL_8_3]#
- class dispel.providers.generic.tasks.cps.steps.ExtractCorrectByThird[source]#
Bases:
ExtractTotalAnswersBase
Number of errors in a specific subset ExtractStep.
- static apply(data, subset, level)[source]#
Compute the number of errors in the selected third.
- Parameters:
data (DataFrame) –
subset (ThirdsModality) –
level (Level) –
- measure_name: AV = number of correct answers (corr)#
- subset_list = [ThirdsModality.FIRST_THIRD, ThirdsModality.SECOND_THIRD, ThirdsModality.THIRD_THIRD, ThirdsModality.SECOND_LAST_THIRD]#
- class dispel.providers.generic.tasks.cps.steps.ExtractCorrectDiffBetweenThird[source]#
Bases:
ExtractTotalAnswersBase
Compute the difference of correct answers between two thirds.
- description: str = 'The difference between the number of correct responses of the {left} of keys and the number of correct responses of the {right} of keys.'#
- function_factory(subset)[source]#
Get function dictionary.
- Parameters:
subset (ThirdsPairModality) –
- Return type:
- measure_name: AV = correct responses difference (corr_diff)#
- third_list: List[ThirdsPairModality] = [ThirdsPairModality.THIRD_2_1, ThirdsPairModality.THIRD_3_1, ThirdsPairModality.THIRD_3_2]#
- class dispel.providers.generic.tasks.cps.steps.ExtractDifferencesKeyReactionTimeBase[source]#
Bases:
KeyAnalysisBase
Difference Reaction Time ExtractStep mix in.
- apply_key(data, key, agg)[source]#
Get apply function for ExtractSteps.
- Parameters:
data (DataFrame) –
key (Any) –
agg (AbbreviatedValue) –
- Return type:
- measure_name: AV = reaction time difference (rt_diff)#
- class dispel.providers.generic.tasks.cps.steps.ExtractDifferencesReactionTimesBase[source]#
Bases:
ExtractReactionTimesBase
A reaction time extraction processing step for five last keys.
- aggregation: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum')]#
- description: str = 'The difference between the mean reaction time of the {left} keys and the mean reaction time of the {right} keys answered by user '#
- measure_name: AV = reaction time difference (rt_diff)#
- class dispel.providers.generic.tasks.cps.steps.ExtractDigit1Error[source]#
Bases:
SequenceTransformMixin
,ExtractStep
Extract how many times an incorrect response was given for digit one.
- class dispel.providers.generic.tasks.cps.steps.ExtractDigitSpecificReactionTimesDTD[source]#
Bases:
KeyReactionTimeBase
Digit to Digit Reaction Time ExtractStep.
The digits 1, 6 and 9 are the most likely to be confused, and they will be used to compute reaction time measures.
- key_list: List[KeyType] = [DigitEnum.DIGIT_1, DigitEnum.DIGIT_6, DigitEnum.DIGIT_9]#
- class dispel.providers.generic.tasks.cps.steps.ExtractDigitSpecificReactionTimesSTD[source]#
Bases:
KeyReactionTimeBase
Symbol to Digit Reaction Time ExtractStep.
- aggregation_list: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum')]#
- key_list: List[KeyType] = [SymbolEnum.SYMBOL_1, SymbolEnum.SYMBOL_2, SymbolEnum.SYMBOL_3, SymbolEnum.SYMBOL_4, SymbolEnum.SYMBOL_5, SymbolEnum.SYMBOL_6, SymbolEnum.SYMBOL_7, SymbolEnum.SYMBOL_8, SymbolEnum.SYMBOL_9]#
- class dispel.providers.generic.tasks.cps.steps.ExtractDigitSymmetryPairedReactionTimes[source]#
Bases:
KeyReactionTimeBase
Pair symmetry Reaction Time ExtractStep.
- apply_key(data, key, agg)[source]#
Get apply function for ExtractSteps.
- Parameters:
data (DataFrame) –
key (SymmetryModality) –
agg (AbbreviatedValue) –
- Return type:
- key_list: List[KeyType] = [SymmetryModality.PAIRED]#
- class dispel.providers.generic.tasks.cps.steps.ExtractDigitSymmetryUniqueReactionTimes[source]#
Bases:
KeyReactionTimeBase
Unique symmetry Reaction Time ExtractStep.
- apply_key(data, key, agg)[source]#
Get apply function for ExtractSteps.
- Parameters:
data (DataFrame) –
key (SymmetryModality) –
agg (AbbreviatedValue) –
- Return type:
- key_list: List[KeyType] = [SymmetryModality.UNIQUE]#
- class dispel.providers.generic.tasks.cps.steps.ExtractErrorInThird[source]#
Bases:
ExtractTotalAnswersBase
Number of errors in a specific subset ExtractStep.
- static apply(data, subset, level)[source]#
Compute the number of errors in the selected third.
- Parameters:
data (DataFrame) –
subset (ThirdsModality) –
level (Level) –
- measure_name: AV = number of errors (err)#
- subset_list = [ThirdsModality.FIRST_THIRD, ThirdsModality.SECOND_THIRD, ThirdsModality.THIRD_THIRD, ThirdsModality.SECOND_LAST_THIRD]#
- class dispel.providers.generic.tasks.cps.steps.ExtractFatigabilityMixin[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
Extract slope coefficients for capturing fatigability.
- feat#
AV to define the slope coefficient or the r2 score of the model.
- apply_fatigability(data, reg_mod)[source]#
Get fatigability apply function.
- Parameters:
data (DataFrame) –
reg_mod (RegressionMode) –
- Return type:
- description: str = 'The {feat} of the linear regression on correctresponse times with {regression_modality} capturing the fatigability of the user '#
- feat: AbbreviatedValue#
- function_factory(reg_mod)[source]#
Get function dictionary.
- Parameters:
reg_mod (RegressionMode) –
- Return type:
- measure_name: AV = fatigability (fat)#
- class dispel.providers.generic.tasks.cps.steps.ExtractKeySpecificReactionTimeDifferencesDTD[source]#
Bases:
ExtractDifferencesKeyReactionTimeBase
Key specific difference Reaction Time ExtractStep.
- key_list: List[KeyType] = [DigitConfusionPairModality.DIGIT_6_9]#
- class dispel.providers.generic.tasks.cps.steps.ExtractKeySpecificReactionTimeDifferencesSTD[source]#
Bases:
ExtractDifferencesKeyReactionTimeBase
Key specific difference Reaction Time ExtractStep.
- aggregation_list: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum')]#
- key_list: List[KeyType] = [SymbolConfusionPairModality.SYMBOL_2_7, SymbolConfusionPairModality.SYMBOL_3_8, SymbolConfusionPairModality.SYMBOL_4_6]#
- class dispel.providers.generic.tasks.cps.steps.ExtractMaxStreaksBase[source]#
Bases:
NotEmptyDataSetAssertionMixin
,SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
A measure extraction processing step.
- class dispel.providers.generic.tasks.cps.steps.ExtractMaxStreaksCorrectAnswers[source]#
Bases:
ExtractMaxStreaksBase
A measure extraction processing step.
- measure_name: AV = maximum streak of correct responses (stk_corr)#
- class dispel.providers.generic.tasks.cps.steps.ExtractMaxStreaksIncorrectAnswers[source]#
Bases:
ExtractMaxStreaksBase
A measure extraction processing step.
- measure_name: AV = maximum streak of incorrect responses (stk_incorr)#
- class dispel.providers.generic.tasks.cps.steps.ExtractNBacks[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
Extract multiple strike pattern measures.
- description: str = 'The {aggregation} reaction time difference between {n_back}-backs occurrences (e.g. the {aggregation} reaction time difference between identical keys encountered in an interval of {n_back} keys) of the user '#
- measure_name: AV = reaction time difference over {n_back}-backs occurrences ({n_back}back)#
- class dispel.providers.generic.tasks.cps.steps.ExtractPressures[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,AggregateRawDataSetColumn
Extract descriptive statistics of applied pressure.
- aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('skew', 'skewness'), ('kurtosis', 'kurtosis')]#
- measure_name: AV = pressure (press)#
- class dispel.providers.generic.tasks.cps.steps.ExtractR2ScoreFatigability[source]#
Bases:
ExtractFatigabilityMixin
Extract r2 scores to assess the quality of the slope coefficients.
- feat: AV = r2 score (r2)#
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionThirdFactory[source]#
Bases:
ExtractReactionTimesBase
Extract reaction time related measures.
- aggregation: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('q95', '95th percentile'), ('q05', '5th percentile'), ('iqr', 'iqr'), ('cv', 'coefficient of variation of')]#
- apply_third(data, subset, agg, level)[source]#
Get Apply function.
- Parameters:
data (DataFrame) –
subset (ThirdsModality) –
agg (str) –
level (Level) –
- Return type:
- function_factory(subset, agg, agg_label)[source]#
Get apply function for ExtractSteps.
- Parameters:
subset (ThirdsModality) –
agg (str) –
agg_label (str) –
- Return type:
- subset_list = [ThirdsModality.FIRST_THIRD, ThirdsModality.SECOND_THIRD, ThirdsModality.THIRD_THIRD, ThirdsModality.SECOND_LAST_THIRD]#
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionTimeDifferencesLastFirst[source]#
Bases:
ExtractDifferencesReactionTimesBase
Extract reaction time difference related measures.
- static apply_last_first_reaction_time(data, agg)[source]#
Difference of reaction time between set beginning and end.
- Parameters:
data (DataFrame) –
agg (str | AbbreviatedValue) –
- Return type:
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionTimeDifferencesThirdDiff[source]#
Bases:
ExtractDifferencesReactionTimesBase
Extract reaction time difference related measures.
- apply_last_first_diff_reaction_time(data, subset, level, agg)[source]#
Difference of reaction time between set beginning and end.
- Parameters:
data (DataFrame) –
subset (ThirdsPairModality) –
level (Level) –
agg (str) –
- Return type:
- function_factory(subset, agg)[source]#
Get function dictionary.
- Parameters:
subset (ThirdsPairModality) –
agg (str) –
- Return type:
- third_list: List[ThirdsPairModality] = [ThirdsPairModality.THIRD_2_1, ThirdsPairModality.THIRD_3_1, ThirdsPairModality.THIRD_3_2]#
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionTimeFiveFirst[source]#
Bases:
ExtractSubsetReactionTimesBase
A reaction time extraction processing step for five first keys.
- aggregation: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('q95', '95th percentile'), ('q05', '5th percentile'), ('iqr', 'iqr'), ('skew', 'skewness'), ('kurtosis', 'kurtosis')]#
- subset: AV | ResponsesModality = 1#
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionTimeFiveLast[source]#
Bases:
ExtractSubsetReactionTimesBase
A reaction time extraction processing step for five last keys.
- aggregation: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('q95', '95th percentile'), ('q05', '5th percentile'), ('iqr', 'iqr'), ('skew', 'skewness'), ('kurtosis', 'kurtosis')]#
- subset: AV | ResponsesModality = 2#
- class dispel.providers.generic.tasks.cps.steps.ExtractReactionTimesBase[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
,NotEmptyDataSetAssertionMixin
An extraction processing step mix in for reaction time.
- measure_name: AV = reaction time (rt)#
- class dispel.providers.generic.tasks.cps.steps.ExtractSlopeFatigability[source]#
Bases:
ExtractFatigabilityMixin
Extract slope coefficients for capturing fatigability.
- feat: AV = slope coefficient (slope)#
- class dispel.providers.generic.tasks.cps.steps.ExtractSubsetReactionTimesBase[source]#
Bases:
ExtractReactionTimesBase
An extraction processing step mix in for subset reaction time.
- subset#
Enumerated constant representing the specific selection modalities
- aggregation: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('q95', '95th percentile'), ('q05', '5th percentile'), ('iqr', 'iqr'), ('skew', 'skewness'), ('kurtosis', 'kurtosis')]#
- subset: AbbreviatedValue | ResponsesModality#
- class dispel.providers.generic.tasks.cps.steps.ExtractTotalAnswerLen[source]#
Bases:
ExtractTotalAnswersBase
Total of answers ExtractStep.
- measure_name: AV = total number of responses (tot)#
- class dispel.providers.generic.tasks.cps.steps.ExtractTotalAnswersBase[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
Mismatching Multiple Extract Steps mix in.
- class dispel.providers.generic.tasks.cps.steps.ExtractTotalErrorPercentage[source]#
Bases:
ExtractTotalAnswersBase
Percentage Total of errors ExtractStep.
- measure_name: AV = percentage of errors (err_per)#
- class dispel.providers.generic.tasks.cps.steps.ExtractTotalNumError[source]#
Bases:
ExtractTotalAnswersBase
Total of errors ExtractStep.
- measure_name: AV = total number of errors (err)#
- class dispel.providers.generic.tasks.cps.steps.ExtractTotalValidAnswerLen[source]#
Bases:
ExtractTotalAnswersBase
Total of correct answers ExtractStep.
- measure_name: AV = number of correct responses (corr)#
- class dispel.providers.generic.tasks.cps.steps.KeyAnalysisBase[source]#
Bases:
SequenceModeKeyModalityDefinitionMixIn
,ExtractCPSSteps
Keys Analysis Multiple Extract Steps mix in.
- key_list#
List of symbol or digits on which to apply analysis
- Type:
List[dispel.providers.generic.tasks.cps.modalities.DigitEnum | dispel.providers.generic.tasks.cps.modalities.SymmetryModality | dispel.providers.generic.tasks.cps.modalities.DigitConfusionPairModality | dispel.providers.generic.tasks.cps.modalities.SymbolConfusionPairModality | dispel.providers.generic.tasks.cps.modalities.ThirdsPairModality | dispel.providers.generic.tasks.cps.modalities.SymbolEnum]
- aggregation_list: List[Tuple[str, str]] = [('mean', 'mean'), ('std', 'standard deviation'), ('median', 'median'), ('min', 'minimum'), ('max', 'maximum'), ('q95', '95th percentile'), ('q05', '5th percentile'), ('iqr', 'iqr')]#
- abstract apply_key(data, key, agg)[source]#
Get the measure value definition.
- Parameters:
data (DataFrame) –
key (Any) –
agg (AbbreviatedValue) –
- Return type:
- function_factory(key, agg)[source]#
Get function factory.
- Parameters:
key (DigitEnum | SymmetryModality | DigitConfusionPairModality | SymbolConfusionPairModality | ThirdsPairModality | SymbolEnum) –
agg (AbbreviatedValue) –
- Return type:
- class dispel.providers.generic.tasks.cps.steps.KeyReactionTimeBase[source]#
Bases:
KeyAnalysisBase
Reaction Time ExtractStep mix in.
- apply_key(data, key, agg)[source]#
Get apply function for ExtractSteps.
- Parameters:
data (DataFrame) –
key (Any) –
agg (AbbreviatedValue) –
- Return type:
- measure_name: AV = reaction time (rt)#
- class dispel.providers.generic.tasks.cps.steps.SequenceModeKeyModalityDefinitionMixIn[source]#
Bases:
object
A Mix in Class for Sequence, mode and key parameters.
- Parameters:
mode – The desired mode to compute the transformation (
digit-to-symbol
,digit-to-digit
).key_set – The specific key set filter on which you desire to extract measures.
sequence – The sequence type
- add_modality(modality)[source]#
Add additional modality.
- Parameters:
modality (AbbreviatedValue) –
- measure_name: AbbreviatedValue#
- class dispel.providers.generic.tasks.cps.steps.SequenceTransformMixin[source]#
Bases:
object
A Mix in Class for Sequence parameters.
- Parameters:
Sequence – The sequence type
- class dispel.providers.generic.tasks.cps.steps.SummarizeCorrectResponses[source]#
Bases:
AggregateModalities
Summarize correct responses irrespective of key set.
- Parameters:
sequence – The CPS sequence for which to aggregate the measures.
- __init__(sequence)[source]#
- Parameters:
sequence (CPSSequence) –
- class dispel.providers.generic.tasks.cps.steps.SummarizeKeySetOneTwoCorrectResponses[source]#
Bases:
SummarizeCorrectResponses
Summarize correct responses of key set one and two.
- class dispel.providers.generic.tasks.cps.steps.SummarizeKeySetOneTwoReactionTimeDiff[source]#
Bases:
AggregateModalities
Summarize reaction time difference of key set one and two.
- __init__(sequence, aggregation, extra_modality)[source]#
- Parameters:
sequence (CPSSequence) –
aggregation (str) –
- class dispel.providers.generic.tasks.cps.steps.SummarizeKeySetOneTwoReactionTimeExtraModality[source]#
Bases:
AggregateModalities
Summarize reaction time for key set one and two.
- __init__(sequence, aggregation, **kwargs)[source]#
- Parameters:
sequence (CPSSequence) –
aggregation (str) –
- class dispel.providers.generic.tasks.cps.steps.SummarizeMeasures[source]#
Bases:
ProcessingStepGroup
A processing step group containing all the measure aggregation steps.
- class dispel.providers.generic.tasks.cps.steps.SummarizeResponseTimes[source]#
Bases:
AggregateModalities
Summarize response times irrespective of key set.
- class dispel.providers.generic.tasks.cps.steps.TransformConfusion[source]#
Bases:
TransformKeyAnalysisBase
Create a confusion matrix between pressed and displayed symbols or digits.
The confusion matrix is either on the symbols or digits CPS keys depending on the current processed level.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: 1 (confusion for 1, float64)>, <RawDataValueDefinition: 2 (confusion for 2, float64)>, <RawDataValueDefinition: 3 (confusion for 3, float64)>, <RawDataValueDefinition: 4 (confusion for 4, float64)>, <RawDataValueDefinition: 5 (confusion for 5, float64)>, <RawDataValueDefinition: 6 (confusion for 6, float64)>, <RawDataValueDefinition: 7 (confusion for 7, float64)>, <RawDataValueDefinition: 8 (confusion for 8, float64)>, <RawDataValueDefinition: 9 (confusion for 9, float64)>]#
- transform_function()#
Compute the confusion matrix for each symbols/digits.
- Parameters:
data (DataFrame) – A pandas data frame coming from
dispel.providers.generic.tasks.cps.steps.TransformKeysAnalysisData
.- Returns:
The confusion matrix for the current level.
- Return type:
- class dispel.providers.generic.tasks.cps.steps.TransformKeyAnalysisBase[source]#
Bases:
TransformStep
Transformation step based on keys-analysis.
- class dispel.providers.generic.tasks.cps.steps.TransformKeysAnalysisData[source]#
Bases:
NotEmptyDataSetAssertionMixin
,TransformUserInputBase
Create a data frame of reaction time per symbol or digit association.
The data frame has three columns, the reaction time to press a key when one is displayed, a column expected with the displayed key, and a column actual with the key pressed by the user.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: expected (expected item.)>, <RawDataValueDefinition: actual (actual item given.)>, <RawDataValueDefinition: mismatching (The error between expected and actual items.)>, <RawDataValueDefinition: reactionTime (reaction time., s)>, <RawDataValueDefinition: tsAnswer (timestamp answer)>]#
- transform_function(level)#
Create a uniform data frame from user responses to perform analyses.
- Parameters:
- Raises:
ValueError – Make sure length between input data and transformed dataset are consistent
- Returns:
The proper pandas data frame containing
expect
,actual
,``reactionTime`` andtsAnswer
pandas.Series to perform the digits or symbols analyses.- Return type:
- class dispel.providers.generic.tasks.cps.steps.TransformNBacks[source]#
Bases:
TransformKeyAnalysisBase
A transform step to extract data frame containing n-backs information.
Extract 1Back, 2Back and 3Back reaction time for correct responses to capture the working memory capacity of participants.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: rtBack1 (reaction time for 1-back back, float64)>, <RawDataValueDefinition: rtCurrent1 (reaction time for 1-back current, float64)>, <RawDataValueDefinition: rtBack2 (reaction time for 2-back back, float64)>, <RawDataValueDefinition: rtCurrent2 (reaction time for 2-back current, float64)>, <RawDataValueDefinition: rtBack3 (reaction time for 3-back back, float64)>, <RawDataValueDefinition: rtCurrent3 (reaction time for 3-back current, float64)>]#
- transform_function()#
Extract 1Back, 2Back and 3Back reaction time for correct responses only.
- Parameters:
data (DataFrame) – A pandas data frame obtained from
dispel.providers.generic.tasks.cps.steps.TransformKeysAnalysisData
.- Returns:
a pandas data frame containing 1,2 and 3 back and current reaction time when each 1,2 or 3 back is displayed for a given level.
- Return type:
- class dispel.providers.generic.tasks.cps.steps.TransformStreakData[source]#
Bases:
NotEmptyDataSetAssertionMixin
,TransformUserInputBase
Extract the longest streak of incorrect/correct responses.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: correct (longest streak of correct responses.)>, <RawDataValueDefinition: incorrect (longest streak of incorrect responses.)>]#