Skip to content

Commit

Permalink
correct signed contrast computation
Browse files Browse the repository at this point in the history
  • Loading branch information
mayofaulkner committed Jan 24, 2025
1 parent 215c99f commit a6a0c77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iblrig/base_choice_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ def get_subject_training_info(self):

def compute_performance(self):
"""Aggregate the trials table to compute the performance of the mouse on each contrast."""
self.trials_table['signed_contrast'] = self.trials_table.contrast * self.trials_table.position
self.trials_table['signed_contrast'] = self.trials_table.contrast * np.sign(self.trials_table.position)
performance = self.trials_table.groupby(['signed_contrast']).agg(
last_50_perf=pd.NamedAgg(column='trial_correct', aggfunc=lambda x: np.sum(x[np.maximum(-50, -x.size) :]) / 50),
ntrials=pd.NamedAgg(column='trial_correct', aggfunc='count'),
Expand Down

0 comments on commit a6a0c77

Please sign in to comment.