def test_dataReader(self): reader = DataReader() removal = OutliersRemoval(cutoff=150) data_game, _ = reader.readGameResults(ASD_PATH) data_gaze, _, _ = reader.readGazeData(ASD_PATH) self.assertEqual(len(data_game), len(data_gaze))
# edges xedges, yedges = np.arange(0, 101, 1), np.arange(0, 101, 1) # x_grid, y_grid = np.mgrid[0:1:100j, 0:1:100j] # positions = np.vstack([x_grid.ravel(), y_grid.ravel()]) for path in zip(game_paths, gaze_paths, result_paths): game_path = path[0] gaze_path = path[1] result_path = path[2] # read game data data_game, game_f_names = reader.readGameResults(game_path) data_game = removal.transformGameResult( data_game) # remove response with RT less that TH data_gaze, data_gaze_obj, gaze_f_names = reader.readGazeData( gaze_path, downsample=True) # data process process = DataProcessor() # dataframe for the results columns = [ "id", "Go", "GoError", "NoGo", "NoGoError", "RT", "RTVar", "Trajectory Area", "Velocity_avg", "Velocity_std", "Acceleration_avg", "Acceleration_std", "Fixation_avg", "Fixation_std", "Distance_avg", "Distance_std", "Angle_avg", "Angle_std", "Sampen_dist", "Sampen_angle", "Spatial_entropy", "GazeObj_entropy", "Sampen_gaze_obj", "Spectral_entropy", "Sampen_velocity", "Sampen_acceleration" ]
from Conf.Settings import ASD_PATH, ASD_DW_PATH, MIN_D_N, CUT_OFF, TYPICAL_PATH, TYPICAL_DW_PATH from scipy import interpolate from statsmodels.tsa.ar_model import AR max_lag = np.zeros(20) max_llf = np.zeros(20) aic_lag = np.zeros(20) bic_lag = np.zeros(20) # read game data reader = DataReader() removal = OutliersRemoval(cutoff=CUT_OFF) # read typical data typical_game, _ = reader.readGameResults(TYPICAL_PATH) typical_game = removal.transformGameResult(typical_game) _, typical_gaze_obj, _ = reader.readGazeData(TYPICAL_DW_PATH, downsample=True) # read asd data asd_game, _ = reader.readGameResults(ASD_PATH) asd_game = removal.transformGameResult(asd_game) _, asd_gaze_obj, _ = reader.readGazeData(ASD_DW_PATH, downsample=True) data_game = typical_game + asd_game data_gaze = typical_gaze_obj + asd_gaze_obj for d in zip(data_game, data_gaze): game = d[0] gaze = d[1] for _, data in game.iterrows(): response_time = data["ResponseTime"]