base correlations

This commit is contained in:
2026-02-03 01:32:06 +01:00
parent 1dce4db909
commit 2408d06098
4 changed files with 257 additions and 0 deletions

View File

@@ -664,5 +664,140 @@ def _():
return
@app.cell(hide_code=True)
def _():
mo.md(r"""
## Correlation Speaking Styles
""")
return
@app.cell
def _(S, data, top3_voices):
ss_or, choice_map_or = S.get_ss_orange_red(data)
ss_gb, choice_map_gb = S.get_ss_green_blue(data)
# Combine the data
ss_all = ss_or.join(ss_gb, on='_recordId')
_d = ss_all.collect()
choice_map = {**choice_map_or, **choice_map_gb}
# print(_d.head())
# print(choice_map)
ss_long = utils.process_speaking_style_data(ss_all, choice_map)
df_style = utils.process_speaking_style_data(ss_all, choice_map)
vscales = S.get_voice_scale_1_10(data)[0]
df_scale_long = utils.process_voice_scale_data(vscales)
joined_scale = df_style.join(df_scale_long, on=["_recordId", "Voice"], how="inner")
df_ranking = utils.process_voice_ranking_data(top3_voices)
joined_ranking = df_style.join(df_ranking, on=['_recordId', 'Voice'], how='inner')
return joined_ranking, joined_scale
@app.cell
def _():
mo.md(r"""
### Colors vs Scale 1-10
""")
return
@app.cell
def _(S, joined_scale):
# Transform to get one row per color with average correlation
color_corr_scale, _ = utils.transform_speaking_style_color_correlation(joined_scale, SPEAKING_STYLES)
S.plot_speaking_style_color_correlation(
data=color_corr_scale,
title="Correlation: Speaking Style Colors and Voice Scale 1-10"
)
return
@app.cell
def _():
mo.md(r"""
### Colors vs Ranking Points
""")
return
@app.cell
def _(S, joined_ranking):
color_corr_ranking, _ = utils.transform_speaking_style_color_correlation(
joined_ranking,
SPEAKING_STYLES,
target_column="Ranking_Points"
)
S.plot_speaking_style_color_correlation(
data=color_corr_ranking,
title="Correlation: Speaking Style Colors and Voice Ranking Points"
)
return
@app.cell
def _():
mo.md(r"""
### Individual Traits vs Scale 1-10
""")
return
@app.cell
def _(S, joined_scale):
_content = """"""
for _style, _traits in SPEAKING_STYLES.items():
# print(f"Correlation plot for {style}...")
_fig = S.plot_speaking_style_correlation(
data=joined_scale,
style_color=_style,
style_traits=_traits,
title=f"Correlation: Speaking Style {_style} and Voice Ranking Points",
)
_content += f"""
#### Speaking Style **{_style}**:
{mo.ui.altair_chart(_fig)}
"""
mo.md(_content)
return
@app.cell(hide_code=True)
def _():
mo.md(r"""
### Individual Traits vs Ranking Points
""")
return
@app.cell
def _(S, joined_ranking):
_content = """"""
for _style, _traits in SPEAKING_STYLES.items():
# print(f"Correlation plot for {style}...")
_fig = S.plot_speaking_style_ranking_correlation(
data=joined_ranking,
style_color=_style,
style_traits=_traits,
title=f"Correlation: Speaking Style {_style} and Voice Ranking Points",
)
_content += f"""
#### Speaking Style **{_style}**:
{mo.ui.altair_chart(_fig)}
"""
mo.md(_content)
return
if __name__ == "__main__":
app.run()