def run(self): pattern = PATHS['data'] + '%s.csv' df = self.exp.get_behav_df(pattern=pattern) agg_acc = stats.accuracy(df, cols='context', values='accuracy', yerr='subjid', order='sorted') agg_rt = stats.aggregate(df[df.accuracy == 'correct'], cols='context', values='rt', yerr='subjid', order='sorted') plt = plot.Plot(ncols=2) if len(df.subjid.unique()) == 1: kind = 'bar' else: kind = 'bean' plt.plot(agg_acc, kind=kind, title='accuracy', ylabel='% correct') plt.plot(agg_rt, kind=kind, title='response time', ylabel='seconds') print agg_acc print agg_rt plt.show()
def test(self): """Analysis of the test phase data """ pattern = self.paths['data'] + '%s_test.csv' df = exp.get_behav_df(self.info['subjid'], pattern=pattern) agg_acc = stats.accuracy(df, rows='session', cols='pos', values='accuracy', yerr='subjid') plt = plot.Plot() plt.plot(agg_acc) plt.show()
def test(self): """Analysis of the test phase data (for 2AFC task) """ pattern = self.paths['data'] + '%s_test.csv' df = exp.get_behav_df(self.info['subjid'], pattern=pattern) agg_acc = stats.accuracy(df, rows='session', cols='pos', values='accuracy', yerr='subjid') plt = plot.Plot() plt.plot(agg_acc) plt.show()
def train(self): pattern = self.paths['data'] + '%s_train.csv' df = exp.get_behav_df(self.info['subjid'], pattern=pattern) dfs = [] for session in df.session.unique(): sdf = df[df.session == session] dfs.append(self._train_acc(sdf)) df = pandas.concat(dfs) agg_acc = stats.accuracy(df, cols='session', values='accuracy', yerr='subjid', incorrect='miss') self.plot(agg_acc)
def run(self): pattern = PATHS['data'] + '%s.csv' df = self.exp.get_behav_df(pattern=pattern) agg_acc = stats.accuracy(df, cols='context', values='accuracy', yerr='subjid', order='sorted') agg_rt = stats.aggregate(df[df.accuracy=='correct'], cols='context', values='rt', yerr='subjid', order='sorted') plt = plot.Plot(ncols=2) if len(df.subjid.unique()) == 1: kind = 'bar' else: kind = 'bean' plt.plot(agg_acc, kind=kind, title='accuracy', ylabel='% correct') plt.plot(agg_rt, kind=kind, title='response time', ylabel='seconds') print agg_acc print agg_rt plt.show()