# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.7.10 64-bit (''base'': conda)'
#     name: python3
# ---

# # Supplementary material figure 2: Words and nonwords growth model's x-intercept

# ## Import libraries

import pandas as pd
import altair as alt
from helper import control_space_heatmap

# ## Import part I raw data

# +
df = pd.read_csv('../../data/growth_params_1250.csv')

df_growth_word = (
    df.loc[df.cond.isin(["HF_CON", "LF_CON", "HF_INC", "LF_INC"]),]
    .groupby(["hidden_units",  "p_noise", "learning_rate"])
    .mean()
    .reset_index()
)

df_growth_nonword = (
    df.loc[df.cond.isin(["NW_UN", "NW_AMB"]),]
    .groupby(["hidden_units", "p_noise", "learning_rate"])
    .mean()
    .reset_index()
)
# -

# ## Word x-intercept

# +
plot_word = control_space_heatmap(
    df_growth_word,
    title="a. Word",
    var="x0",
    color_scheme="lightgreyred",
    domain=(0,.4),
    font_size=24,
    epsilon_label="Epsilon (panel column)"
)

plot_word
# -

# ## Nonword x-intercept

# +
plot_nonword = control_space_heatmap(
    df_growth_nonword,
    title="b. Nonword",
    var="x0",
    color_scheme="lightgreyred",
    domain=(0, .4),
    font_size=24,
    epsilon_label=""
)

plot_nonword

StarcoderdataJupyterScriptsDedupFiltered