[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify code snippets into one of the following categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']."}, {'role': 'user', 'content': "Identify the single most appropriate category to which the provided code belongs. Provide your response as a single category label without any additional information, commentary, or personal opinions.\\nPython Code:def get_reaction_data(mask_file, feat_file, th, is_reversal, time_window_s, fps):\nwith tables.File(mask_file) as fid:\nmean_intensity = fid.get_node('/mean_intensity')[:]\nwith pd.HDFStore(feat_file, 'r') as fid:\nfeat_timeseries = fid['/features_timeseries']\nmed = np.median(mean_intensity)\nmad = np.median(np.abs(mean_intensity-med))\nlight_on = mean_intensity >  med + mad*6\nreact_frac = get_reaction_fraction(feat_timeseries, th, is_reversal, time_window_s, fps)\nreturn (light_on, react_frac)\ndef plot_reaction(mask_dir, result_dir, th, is_reversal, time_window_s, fps):\nfeat_files = glob.glob(os.path.join(result_dir, '*_features.hdf5'))\nfeat_files = sorted(feat_files, key=lambda x:x.split('_')[-2])\nfeat_files = [x for x in feat_files if any(os.path.basename(x).startswith(good) for good in ['A', 'B'])]\nmask_files = [x.replace('_features.hdf5', '.hdf5') for x in feat_files]\nif mask_dir != result_dir:\nmask_files = [x.replace(result_dir, mask_dir) for x in mask_files]\nreaction_data = {}\nn_rows = round(len(mask_files)/2)\nplt.figure(figsize=(20,20))\nfor ii, (mask_file, feat_file) in enumerate(zip(mask_files, feat_files)):\nlight_on, react_frac = get_reaction_data(mask_file,\nfeat_file,\nth, is_reversal, time_window_s, fps)\nbase_name = os.path.basename(mask_file).replace('.hdf5', '')\nreaction_data[base_name] = (light_on, react_frac)\nplt.subplot(n_rows, 2, ii+1)\nif is_reversal:\nlab_t = 'fraction worms going backwards'\nelse:\nlab_t = 'fraction worms going forward'\nxx = np.arange(light_on.size)/fps\ngood = ~np.isnan(react_frac)\nd1, = plt.plot(xx[good], react_frac[good], label=lab_t)\nd2, = plt.plot(xx, light_on, label = 'light on')\nplt.legend(handles=[d1, d2], loc=2, prop={'size':12})\nplt.ylim((0, 1.2))\nplt.title(base_name, fontsize=14)\nplt.xlabel('time (s)', fontsize=14)\nreturn reaction_data"}, {'role': 'assistant', 'content': 'data_exploration'}]