Bias evolution#
Repeat / alternate and left / right bias through training.

from matplotlib import pyplot as plt
from lecilab_behavior_analysis.metrics.choices import get_bias_evolution_df
from lecilab_behavior_analysis.plots import bias_triangle_plot
df = trials[["subject", "total_trial", "roa_choice_numeric"]].copy()
group_size = max(len(df) // 40, 1)
df["trial_group"] = df["total_trial"] // group_size * group_size
evolution = get_bias_evolution_df(df, groupby="trial_group")
fig, ax = plt.subplots(figsize=(5, 4))
bias_triangle_plot(evolution, hue="trial_group", trajectory=True, ax=ax)
trials, day, summary, events and cohort are the inputs of the examples. Back to the gallery