Reaction Processor¶
- class reaction_processor.ReactionProcessor(window=6)¶
Reaction Processor class. Consumes Reaction Time Series to compute related features.
These values are recommended by the author of the pilot study [KSR+15]. Check reference for more details.
window = 6 #seconds
- Example:
>>> import pdkit >>> rp = pdkit.ReactionProcessor() >>> rs = pdkit.ReactionTimeSeries().load(path_to_data, 'opdc_react') >>> rp.extract_features(rs)
- extract_features(data_frame, pre='')¶
This method extracts all the features available under the Reaction Processor class.
- Parameters:
data_frame (pandas.DataFrame) – the data frame
- Returns:
‘frequency’, ‘moving_frequency’,’continuous_frequency’,’mean_moving_time’,’incoordination_score’, ‘mean_alnt_target_distance’,’kinesia_scores’, ‘akinesia_times’,’dysmetria_score’
- Return type:
list
- reaction_times(data_frame)¶
Computer press, raise and total reaction times.
- Parameters:
data_frame (pandas.DataFrame) – the data frame
- Return press:
avg time from button visible until button pressed
- Rtype press:
float
- Return raise:
avg time from button removed until button released
- Rtype raise:
float
- Return total:
avg total reaction time
- Rtype total:
float
Reaction Time Series¶
- class reaction_time_series.ReactionTimeSeries¶
This is a wrapper class to load the Reaction Time Series data.
- load(filename, format_file='opdc_react', button_left_rect=None, button_right_rect=None)¶
This is a general load data method where the format of data to load can be passed as a parameter,
- Parameters:
filename (str) – The path to load data from
format_file (str) – format of the file. Default is CloudUPDRS. Set to mpower for mpower data.
- Return dataframe:
data_frame.x, data_frame.y: components of tapping position. data_frame.x_target, data_frame.y_target their target. data_frame.index is the datetime-like index
References
Panagiotis Kassavetis, Tabish A. Saifee, George Roussos, Loukas Drougkas, Maja Kojovic, John C. Rothwell, Mark J. Edwards, and Kailash P. Bhatia. Developing a tool for remote digital assessment of parkinson's disease. Movement Disorders Clinical Practice, 3(1):59–64, 2015.
Joshua S. Richman and J. Randall Moorman. Physiological time-series analysis using approximate entropy and sample entropy. American Journal of Physiology-Heart and Circulatory Physiology, 278(6):H2039–H2049, 2000.
Granville Tunnicliffe Wilson. Time series analysis: forecasting and control. Journal of Time Series Analysis, 37(5):709–711, 2015.
Jennifer M. Yentes, Nathaniel Hunt, Kendra K. Schmid, Jeffrey P. Kaipust, Denise McGrath, and Nicholas Stergiou. The appropriate use of approximate entropy and sample entropy with short data sets. Annals of Biomedical Engineering, 41(2):349–365, 2013.
P. D. Welch. The use of fast fourier transform for the estimation of power spectra: a method based on time averaging over short, modified periodograms. IEEE Trans. Audio \amp Electroacoust., 15:70–73, 1967.